tags:

views:

59

answers:

1

I have a set of points

1 1
2 5
3 10
4 20
... ...

How can I plot this in a graphic in matlab? When I try to select in the workspace the my "points" variable and hit "plot" in the menu, it will plot the first column as blue and the second one as green. I believe it considers both columns as different functions, and that is not what I want. My first column should be the X and the second one the Y.

Thanks

+5  A: 
p = rand(50, 2);            %# 50 random points
plot(p(:,1), p(:,2), 'r.')  %# plot data as red points with 1st column
                            %# as x-coordinate, and 2nd column as y-coordinate
Amro

related questions