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

1 Ansicht (letzte 30 Tage)
Federico
Federico am 5 Dez. 2011
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 Kommentar
Jan
Jan am 5 Dez. 2011
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.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Fangjun Jiang
Fangjun Jiang am 5 Dez. 2011
x=1:10;
y=1:10;
plot(x(1:end-1),y(1:end-1));
hold on;
plot(x(end),y(end),'+');

Federico
Federico am 5 Dez. 2011
Thank you sir. :)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by