Plotting the updated values from if statement under for-loop
显示 更早的评论
...................... % 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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Exploration and Visualization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!