MATLAB: Can’t I plot such an easy graph

cell arrayplot

Dear community,
Why can't I plot such an easy graph?
for i = 1:100
x(1,:) = 1 + 2*i;
y(1,:) = 3 + i;
I have two arrays, how can I plot this?
Thanks in advance

Best Answer

  • Use
    v = 1:100;
    x(1,:) = 1+2.*v;
    y(1,:) = 3+v;
    Why loop when you don't have to?