Specifications
User Interface Controls
1-31
For example, these settings create a horizontal slider.
Current Value, Range, and Step Size
There are four properties that control the range and step size of the slider:
•
Value – contains the current value of the slider.
•
Max – defines the maximum slider value.
•
Min – defines the minimum slider value.
•
SliderStep – specifies the size of a slider step with respect to the range.
The
Value property contains the numeric value of the slider. You can set this
property to specify an initial condition and query it in the slider’s callback to
obtain the value set by the user. For example, your callback could contain the
statement.
slider_value = get(handles.slider1,'Value');
The Max and Min properties specify the slider’s range (Max - Min).
The
SliderStep property controls the amount the slider Value property
changes when you click the mouse on the arrow button or on the slider trough.
Specify
SliderStep as a two-element vector. The default, [0.01 0.10], provides
a 1 percent change for clicks on an arrow and a 10 percent change for clicks in
the trough. The actual step size is a function of the slider step and the slider
range.