MATLAB: How to plot with continuous line


Hi, I have an array and I want to plot it into graph. My problem is I got a dotted graph line and not a continuous one. How should I change my code to solve this problem? My code look like this:
Figure(1) hold on
for i= 1:5 array(i) = i*3; plot (i, array(i)); end

Best Answer

Use plot after the loop
for ii= 1:5
array(ii) = ii*3;
plot (x, array);
%don't use i and j as variables (used with comlex numbers)