Matlab plot: create a line b/w the points except the last one?

Hey guys,
I have got this plot with some points, I want to only create a line between some of them. Let's say I don't want to connect the last point on the right of the plot, but I still want to have the point.
How do I do it?
Thanks

1 件のコメント

Jan
Jan 2011 年 12 月 5 日
It would be much easier to show the needed code, if you post a running example code, which produces your graphics except for the requested detail.

サインインしてコメントする。

回答 (2 件)

Fangjun Jiang
Fangjun Jiang 2011 年 12 月 5 日

1 投票

x=1:10;
y=1:10;
plot(x(1:end-1),y(1:end-1));
hold on;
plot(x(end),y(end),'+');

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

タグ

質問済み:

2011 年 12 月 5 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by