Put a set values to slider in Matlab Guide
11 次查看(过去 30 天)
显示 更早的评论
I want to put a set of values to my slider in Matlab Gui so it will be able to discreetly go through these values.
eg. Numbers written in x variable will be presented on the slider ( only these numbers)
How to do it in Matlab Guide?
0 个评论
回答(1 个)
Image Analyst
2013-8-18
编辑:Image Analyst
2013-8-18
You can set the max and min and value of the slider using the set function:
set(handles.slider1, 'value', someValue);
but it won't display. To do that you need to place a static text label near the slider (say, above it). Then set the string value of the label:
caption = sprintf('Slider value = %.3f', someValue);
set(handles.sliderLabel, 'String', caption);
3 个评论
Image Analyst
2013-8-18
What do you want your label to look like? Just use sprintf() to build it up however you want it.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!