Reputation: 617
I'm trying to plot the graph below
I'm new to GNU Octave and its syntax, I'm not able to correctly write out data points at predetermined X values. I thought writing Y as a 2-dimensional matrix would work (as long as it had the same number of columns as X) but it just made two lines instead of one, like
y = [ 0.1, 0.15, 0.2 , 0.3, ... ; 180, 40, -20, -60, ... ]
Should I write it as a set of pairs of numbers?
The only thing I got right is the X axis.
x = 0;0.5;5;
Upvotes: 0
Views: 568
Reputation: 2119
You can just use the plot(x,y)
function, it will draw y-values on given x-values.
x = [1,2,3,4];
y = [5,8,3,5];
plot(x,y);
Upvotes: 2