How can I change animation speed in a plot?

3 次查看(过去 30 天)
Hello everyone!
I am trying to plot an animation using animatedline function and also controlling the speed of the animation using popupmenu. (such as 1/2x,1x,2x,4x etc).
I don't have any problem to create my animations in different speed.
The problem is , for example when I click "case 3" it starts to plot the animation and when I click case 4 (without waiting the end of the animation of case 3) it creates new one (case 4). Until this time still I don't have any problem. However, when "case 4" is ended the previous selection is going on (case 3). I want to figure out this issue. What I want is it should forget the previous one once I make a new selection.
I attached my code in below.
Is there any solution for this problem?
Thanks in advance.
switch get(handles.threeDOF_animation_speed,'Value')
case 1
case 2
run('threeDOF_create_animation.m')
set(handles.button_3DOF_save_gif,'Enable','on')
case 3
run('threeDOF_create_animation.m')
set(handles.button_3DOF_save_gif,'Enable','on')
case 4
run('threeDOF_create_animation.m')
set(handles.button_3DOF_save_gif,'Enable','on')
case 5
run('threeDOF_create_animation.m')
set(handles.button_3DOF_save_gif,'Enable','on')
end
  1 个评论
Anmol Dhiman
Anmol Dhiman 2019-11-12
Try using break within the switch case statements. If possible share the code to replicate the issue.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by