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
You need to convert the names in
vector3to numbers, then you can call theplotcommand.For example