How to plot multiple iterations on the same axes?
6 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm trying to plot the below.
In x-axis, I have
s_x_index=[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10]
In y-axis, I have a signal f_x, whose value keeps on changing for each iteration. Now I need to plot in such a way that, s_x_index takes the current f_x value and the other curve in the plot should result from s_x_index taking the next value of f_x obtained during the next iteration.
Please do help.
0 个评论
回答(2 个)
rifat
2014-5-27
first, write
figure; hold on;
then use a loop. witing each iteration plot your curve.
plot(s_x_index,f_x)
Mahdi
2014-5-27
figure; hold on
for i=1:length(s_x_index)
f_value(i)=f_x # This is the value that you get from each iteration
end
plot(s_x_index,f_value)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!