How to make a while loop to repeat multiple times with different values of variable?
2 views (last 30 days)
Show older comments
I would like to repeat my while loop multiple times, each time with different q value (q changes from 0.5 to 4). In my example q=0. For q=0 I got one curve in a plot. How can I get the plot with multiple curves, each corresponding to different q value.
t_in_before=19;
q=0.9;
t_out=-1;
time=0;
while t_in_before>5
t_in_after=t_in_before + (q*t_out)/154 - (q*t_in_before)/154;
time=time+1;
t_in_before=t_in_after;
plot(time,t_in_after,'b.-')
hold on
end
0 Comments
Accepted Answer
More Answers (0)
See Also
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!
