How can I increase GUI slider steps?
10 次查看(过去 30 天)
显示 更早的评论
I have 168 MRI images to scroll. But my slider goes 1,3,5,6,8,10...almost every second image is shown. I've count them and turn out to be that slider has a exactly hundred steps. How can I increase that steps that slider shows one by one image?
Thanks.
2 个评论
Stephen23
2019-2-24
编辑:Stephen23
2019-2-24
Note that the accepted answer is incorrect. The actual required limits are:
[1/(maxNumberOfImages-1) , 10/(maxNumberOfImages-1)]
^ ^^^ ^ ^^^ missing in the answer
The general solution is actually:
stepSize/(maxLimit-minLimit)
which should make the mistake in the accepted answer clear. See also:
Image Analyst
2019-2-24
Good catch Stephen. I've made the change in case someone sees only my answer below and not your correction. Thanks!
采纳的回答
Image Analyst
2012-11-5
编辑:Image Analyst
2019-2-24
To setup:
maxNumberOfImages = 168;
set(handleToSlider, 'Min', 1);
set(handleToSlider, 'Max', maxNumberOfImages);
set(handleToSlider, 'Value', 1);
set(handleToSlider, 'SliderStep', [1/(maxNumberOfImages-1) , 10/(maxNumberOfImages-1) ]);
To use and find out which value the user is on:
imageNumberSelected = int32(get(handleToSlider, 'Value'));
3 个评论
Md. Ashfaque
2013-10-1
The two values for the SliderStep property specify how much the slider moves when you hold and scroll it and how much it moves you click the arrows at the side.
更多回答(1 个)
Andy
2017-11-17
this ('SliderStep' property) doesn't exist in slider object of the gui designer.
1 个评论
Image Analyst
2017-11-17
I find that hard to believe. Attach a screenshot of the property inspector with your slider properties showing.
另请参阅
类别
在 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!