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
2019-11-12
Try using break within the switch case statements. If possible share the code to replicate the issue.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!