%in this m-file we are taking row vectors as points in 2-d space
%let us first visualise the points.
%a point in 2d space is represented with x and y coordinates as [x y] with
%respect to some arbitrary origin
origin =[0 0];%this is the origin
point1 =[2 3];% this is one arbitrary point
point2= [8 -5];%this is the second arbitrary point
plot(origin (1),origin (2),'ob');%origin is plotted in blue circle
hold on
plot(point1 (1),point1 (2),'or');%point 1 is plotted in red circle
hold on
plot(point2(1),point2 (2),'og');%point 2 is placed in green circle
grid on
Now we have written our first matlab code for getting the points in our 2 d space.
%let us first visualise the points.
%a point in 2d space is represented with x and y coordinates as [x y] with
%respect to some arbitrary origin
origin =[0 0];%this is the origin
point1 =[2 3];% this is one arbitrary point
point2= [8 -5];%this is the second arbitrary point
plot(origin (1),origin (2),'ob');%origin is plotted in blue circle
hold on
plot(point1 (1),point1 (2),'or');%point 1 is plotted in red circle
hold on
plot(point2(1),point2 (2),'og');%point 2 is placed in green circle
grid on
Now we have written our first matlab code for getting the points in our 2 d space.
No comments:
Post a Comment