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

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 24 Nov. 2012
Bearbeitet: Azzi Abdelmalek am 24 Nov. 2012

0 Stimmen

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

5 Kommentare

K
K am 24 Nov. 2012
Thank you very much for your reply. Can I know why I need to use the complex number?
Azzi Abdelmalek
Azzi Abdelmalek am 24 Nov. 2012
No, I did say don't use i or j as variables in your code, just choose other variables, k,l,m,n,... Because ii*3 can be confused with the complex number ii*3
K
K am 24 Nov. 2012
Ooo..now I understand..Thank you
K
K am 24 Nov. 2012
One more question. Do you know what is the maximum elements of array that Matlab can support?
Azzi Abdelmalek
Azzi Abdelmalek am 24 Nov. 2012
Bearbeitet: Azzi Abdelmalek am 24 Nov. 2012
I can't tell exactly, that depends on your matlab version, also on your computer power and memory. look at this link http://www.mathworks.com/support/solutions/en/data/1-IHYHFZ/index.html

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Performance finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by