Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3996956
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:20:33+00:00 2026-05-20T07:20:33+00:00

I have this situation and I can’t solve it in the proper way. The

  • 0

I have this situation and I can’t solve it in the proper way. The problem is this:
I have 3 vectors:

  • Vector1 = [name1 name2 name3 name4 … nameN] (string names)
  • Vector2 = [time1 time2 time3 time4] (Double)
  • Vector3 = [time1:name4 time2:name1 time3:name1 time4:name1] (double:String)

I want to do the following in matlab:

1- Put Vector 1 in Y axis with names
– I could do it with this code:

   set(gca, 'YTick',1:N, 'YTickLabel',Names(:,1))

2- put Vector 2 in X axis with, to simulate time line

3- Once we have both axis X&Y I’d like to use the 3 Vector to plot point in the graph

For example, 3 Vector contains secuentially timestamps and in each timestamp is executed the nameN, so I’d like to plot a dot in the graph using 3 vector as input.

Any suggestion?Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:20:33+00:00Added an answer on May 20, 2026 at 7:20 am

    You need to convert the names in vector3 to numbers, then you can call the plot command.

    For example

    names = {'a','b','c','d'}; %# use a cell array (curly brackets) for strings
    time = [10 20 30 40 50];
    data = {10,'d';20,'b';40,'c'}
    
    %# convert data to numeric xData, yData
    xData = cell2mat(data(:,1));
    [dummy,yData] = ismember(data(:,2),names);
    
    %# plot
    plot(xData,yData,'.') %# plot dots
    set(gca,'YTick',1:length(names),'YTickLabel',names,'XTick',time)
    
    %# make sure the axes limits aren't too tight
    xlim([0,60]),ylim([0,5])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this odd situation and I can't think of a solution for it.
I have a problem with the cut function. I have this situation: codice 1
I have this situation and I can't figure out why it is not working.
Hi I try solve this situation. I have WPF app with MVVM design. I
I have this situation: I have a page where I can edit users info(name,
I will attempt to explain this situation as clearly as I can. I have
Can someone guide me on the best practice for this situation; I have a
I have this situation: $(#button).toggle(function(){ $(#window).animate({top:'0%'},1000); },function(){ $(#window).animate({top:'-100%'},1000); }); but I need change it
I have this situation: http://jsfiddle.net/bRDgK/3/ In this situation I have a modal dialog with
I have this situation: { float foo[10]; for (int i = 0; i <

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.