app designer Slider object properties does not contain a 'SliderStep' property
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Andy
el 17 de Nov. de 2017
Comentada: Chanchal Dass
el 14 de Sept. de 2021
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 comentarios
Olivier Camus
el 8 de Dic. de 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
el 28 de Abr. de 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!
Respuesta aceptada
Greg
el 2 de Dic. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!