autorun slider

4 次查看(过去 30 天)
Hoang Ton
Hoang Ton 2012-5-14
hi, i already built slider in GUI, however in this moment i want to run the slider automatically (if i can control by the play and stop is better). how can i do that??? i'm completely stuck thank you!

采纳的回答

Image Analyst
Image Analyst 2012-5-14
Set the value property of it, after you've set up the max and min properties of course.
set(handles.slider1, 'Min', theMinValue);
set(handles.slider1, 'Max', theMaxValue);
set(handles.slider1, 'Value', theCurrentValue);
  8 个评论
Walter Roberson
Walter Roberson 2012-5-16
Start a timer function. It updates the Value of the slider, and calls the slider callback.
cb = get(handles.MySlider,'Callback');
cb{1}(handles.MySlider,[])
When the stop button is pushed, stop the timer.
Evans Njihia
Evans Njihia 2018-2-1
Hi, Its not working on my side. what could be wrong and I want to use a timer to move the slider automatically up and down

请先登录,再进行评论。

更多回答(1 个)

Violeta Yolanda Portero López
Hello, did you finally got it? I am trying the same
  1 个评论
Image Analyst
Image Analyst 2019-8-19
I use sliders/scrollbars in GUIDE all the time. If yours doesn't work, attach your .fig and .m file in a new question.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Call Python from MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by