Reputation: 5146
I just wanna draw a portion of a line. I'll try to be more specific.
Now I wanna see just a portion of the red line..but I don't know how to do it in Matlab. I wanna show like a little portion around the red dot.
Upvotes: 1
Views: 185
Reputation: 20915
Use plot
command:
x = [0 3];
y = [1 -4];
plot(x,y,'r');
In order to draw 2 shapes together, use hold on
:
x = -2*pi:0.01:2*pi;
y = sin(x);
plot(x,y,'k');
hold on;
x = [0 3];
y = [1 -4];
plot(x,y,'r');
Upvotes: 2
Reputation: 5359
use line
to draw what you need. Say you want to draw a point going from (0,1) to (3,-4), type:
line ([0 3], [1 -4])
Upvotes: 1