How to plot one variable with every value of another in loop
显示 更早的评论
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 个评论
Walter Roberson
2013-3-30
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!