How to plot one variable with every value of another in loop
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 30 de Mzo. de 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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!