Reputation: 2200
Is possible to draw lines in octave with plot or plot3?
I mean, to define a matrix with points and plot them in pairs automatically.
Thanks in advance.
Upvotes: 3
Views: 7440
Reputation: 1003
Yes, it's very easy to draw lines in Octave. It is, by the way, the same as in Matlab.
When you say that you have a "matrix with points" I assume you mean a n x 2 matrix. If the matrix is called "points" then you would simply do "plot(points(:,1), points(:,2), '-')". If you have a 2 x n matrix you would do "plot(points(1,:), points(2,:), '-')".
Upvotes: 4