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

5 次查看(过去 30 天)
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 个评论
Olivier Camus
Olivier Camus 2017-12-8
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 2020-4-28
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!

请先登录,再进行评论。

采纳的回答

Greg
Greg 2017-12-2
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by