app designer Slider object properties does not contain a 'SliderStep' property

1 visualizzazione (ultimi 30 giorni)
Hello Team,
As of 2017b, an app designer slider object has following properties:
Show all properties
BeingDeleted: 'off'
BusyAction: 'queue'
CreateFcn: ''
DeleteFcn: ''
Enable: 'on'
FontAngle: 'normal'
FontColor: [0 0 0]
FontName: 'Helvetica'
FontSize: 12
FontWeight: 'normal'
HandleVisibility: 'on'
InnerPosition: [29 640 207 3]
Interruptible: 'on'
Limits: [1 10]
MajorTickLabels: {'1' '2' '3' '4' '5' '6' '7' '8' '9' '10'}
MajorTickLabelsMode: 'auto'
MajorTicks: [1 2 3 4 5 6 7 8 9 10]
MajorTicksMode: 'manual'
MinorTicks: [1 2 3 4 5 6 7 8 9 10]
MinorTicksMode: 'manual'
Orientation: 'horizontal'
OuterPosition: [23 610 221 39]
Parent: [1×1 Figure]
Position: [29 640 207 3]
Tag: ''
Type: 'uislider'
UserData: []
Value: 3.8261
ValueChangedFcn: [function_handle]
ValueChangingFcn: ''
Visible: 'on'
'SliderStep' is not one of them.
How do you enforce a slider step to be a specific value?
Thanks
  2 Commenti
Olivier Camus
Olivier Camus il 8 Dic 2017
Personally, I have created a slider to look at different images in a multipage image file. To make sure the slider increments only on integer values I have in my callback function: newValue = round(slider.Value) %variable slider.Value = newValue The second line allows for the slider to update to this rounded value. Hope this helps.
Pranaya Kansakar
Pranaya Kansakar il 28 Apr 2020
Hi Oliver
Would you mind sharing the code for your slider? I'm trying to do something similar but am having difficulty doing so.
Thanks!

Accedi per commentare.

Risposta accettata

Greg
Greg il 2 Dic 2017
There is no need for a SliderStep property anymore. The old slider had arrows for "small step" and click inside but not on the "thumb" for "large step." The new slider automatically jumps to the clicked location, or can be click-and-dragged.
If you are trying to make it a discrete slider, use the ValueChangedFcn or ValueChangingFcn to validate the slider's value. Or use a discrete knob.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by