i need help for this, setting slider steps!!!!!​!!!!!!!!!!​!!!!!!!!!!​!!!!

22 次查看(过去 30 天)
Hello
I want to increment the value of my slider by one like [1:1:80]. For example :
1 2 3 4 5 6 7 8.......... until the value 80
how can I do this ?????
Can I do this with the Property Inspector????

采纳的回答

Image Analyst
Image Analyst 2015-11-12
编辑:Image Analyst 2015-11-13
In code (your m-file) you can get the min and max and make the step one over the range:
maxSliderValue = get(handles.slider1, 'Max');
minSliderValue = get(handles.slider1, 'Min');
theRange = maxSliderValue - minSliderValue;
steps = [1/theRange, 10/theRange];
set(handles.slider1, 'SliderStep', steps);
Put this in your GUI's OpeningFcn function or whenever you change the slider's max value (which you probably don't do in your program.)
If you do it in the Property Inspector and have 1 as the min and 80 as the max, you should set the small step to 1/79 = 0.012658227848101, and the large step as some multiple of that, like 2 or 3 times as large.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by