How to plot one variable with every value of another in loop
Ältere Kommentare anzeigen
R=250;
for d=0:R
HMmax=20;
for i=1:10:250
HM1(i)= max(HMmax*((1-d/R)^4),0);
end
plot(HM1(i),d);
end
For every value of HM1, plot d.
2 Kommentare
Walter Roberson
am 30 Mär. 2013
Why? In your "for i" loop, the only thing that changes is the subscript of HM1, so all the HM1 are going to be identical. There does not appear to be any value in plotting d for each value of HM1.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!