Matlab how to plot from the origin to a point (x,y)
Favorites|Homepage
Subscriptions | sitemap
HOME > Engineering > Matlab how to plot from the origin to a point (x,y)

Matlab how to plot from the origin to a point (x,y)

[From: ] [author: ] [Date: 11-05-14] [Hit: ]
p1y,plot(p2x,p2y,plot(p3x,p3y,plot(p4x,......
Hi all,

I have a graph of points using

plot(p1x,p1y,'X')
hold on;
plot(p2x,p2y,'X')
plot(p3x,p3y,'X')
plot(p4x,p4y,'X')
hold off;
title('')
xlabel('')
ylabel('')
grid

but i want to have a line from (0,0) to the points i have. I would love to have an arrow, but i line will do. I can't seem to get it to work I've had some crazy lines going in seemly ramdom directions.

Any help wold great :-)

Thanks

-
% from (0, 0) to (3, 4)
x = linspace(0, 3, 100);
y = linspace(0, 4, 100);
plot(x,y)
hold on

% from (0, 0) to (5, 3)
x = linspace(0, 5, 100);
y = linspace(0, 3, 100);
plot(x,y)
1
keywords: origin,from,Matlab,point,plot,to,how,the,Matlab how to plot from the origin to a point (x,y)
New
Hot
© 2008-2010 http://www.science-mathematics.com . Program by zplan cms. Theme by wukong .