Trying to create a natural log animation plot that shows the data points using the delay function
显示 更早的评论
I came across an interesting code yesterday that created a natural log plot that used the delay function to plot the points of the graph slowly. Unfortunately I can not find this code and have been trying to replicate it on my own. As of now I have the following
x = (0:0.2:10);
y = log(x);
delay (0:0.1);
for i = 1:numel(x)
plot(i,y(i));
drawnow
end
However this code is not working and I'm a bit rusty at coding in matlab and would really appreciate some help.
Thank you
1 个评论
采纳的回答
更多回答(1 个)
Walter Roberson
2016-3-10
Perhaps you are thinking of something like
x = (0:0.2:10);
y = log(x);
xlim([x(1), x(end)]);
ylim([-4, y(end)]);
hold on
for i = 1:numel(x)
plot(x(i),y(i), '*');
pause(0.1);
end
4 个评论
Alexander
2016-3-11
Walter Roberson
2016-3-11
I was not able to find any function named "delay" in any of the toolboxes. I found Delay blocks for Simulink, and Delay having to do with some signal processing, but nothing that would affect animation. Is it possible you were looking at something that used PsychTools, the toolbox for psychometric experiments?
Alexander
2016-3-11
Alexander
2016-3-11
类别
在 帮助中心 和 File Exchange 中查找有关 Animation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!