Plotting Matrix points
古いコメントを表示
Hello everyone!
I have a 2 by 10 matrix:
B =
28.7636 27.7497
26.7351 25.7208
23.6934 22.6793
20.6512 19.6371
18.6241 17.6092
15.5820 14.5679
13.5537 11.5246
10.5116 9.4974
8.4835 6.4551
5.4414 4.4273
I am trying to figure out how to plot these matrix points in pairs:
28.7636 27.7497 % start of first point and end of first point
26.7351 25.7208 % start of 2nd point and end of 2nd point
And so on...
I haven't been able to determine the correct plot syntax to accomplish this. Matlab has so many commands when it comes to plotting I dont even know where to start!
Thank in advance!
5 件のコメント
Sean de Wolski
2011 年 7 月 20 日
Could you find an example image on google images or somewhere (or make one in powerpoint) of what you want to see. There's clearly a communication boundary since four of us are missing the target.
B_Richardson
2011 年 7 月 20 日
B_Richardson
2011 年 7 月 20 日
B_Richardson
2011 年 7 月 20 日
Fangjun Jiang
2011 年 7 月 20 日
Your figure is almost done with the Horizontal lines solution I provided.
採用された回答
その他の回答 (4 件)
Fangjun Jiang
2011 年 7 月 19 日
Not enough information. Your B is 10x2 matrix, not 2x10. Maybe:
a=[1:10;1:10];
line(a,B');
Horizontal lines:
line(B',zeros(2,10));
hold on;
plot(B,zeros(10,2),'o');
Vertical lines:
line(zeros(2,10),B');
hold on;
plot(zeros(10,2),B,'o');
7 件のコメント
B_Richardson
2011 年 7 月 19 日
Fangjun Jiang
2011 年 7 月 19 日
Then use line(B',a)
Fangjun Jiang
2011 年 7 月 19 日
or line(B',ones(2,10))
Fangjun Jiang
2011 年 7 月 19 日
or could be line(B',zeros(2,10))
B_Richardson
2011 年 7 月 19 日
Fangjun Jiang
2011 年 7 月 20 日
Should the start time be less than the stop time? Maybe it doesn't matter. Should horizontal lines be more suitable than vertical lines since they indicate time lapse? Anyway, see edit in my answer for both options.
B_Richardson
2011 年 7 月 20 日
B_Richardson
2011 年 7 月 19 日
3 件のコメント
Walter Roberson
2011 年 7 月 19 日
It wasn't clear from the above that you wanted both points to have the same x value; indeed, I had gathered from the earlier discussion that everything was to be spread out on a line (with gaps)
B_Richardson
2011 年 7 月 19 日
B_Richardson
2011 年 7 月 19 日
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!