Plotting the updated values from if statement under for-loop
Show older comments
...................... % lines of code
...................... % lines of code
n = 70
dt = 0.1 % 0.1second increment
for i = 1:n
t = dt*(i-1); % elapsed time
................. % lines of code
................. % lines of code
if (condition)
tipper(A,B,r); % calling a function called tipper that outputs delta_q
elapsed_time = t
plot(elapsed_time, delta_q)
else
fprintf('Not happening\n');
end
end
Whenever the first condition is satisfied, I need to plot delta_q (output from a function called tipper) vs. elapsed_time for all i values from 1 to n (I believe there will be gaps in the plot where the 'Not happening' occurs). The 'plot(elapsed_time, delta_q)' part in the code doesn't seem to work.
Accepted Answer
More Answers (0)
Categories
Find more on Exploration and Visualization 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!