How to plot one variable with every value of another in loop
Show older comments
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 Comments
Walter Roberson
on 30 Mar 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.
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!