App Designer initial value for UserData for Slider
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to return from a slider a different value than its Value property (that is, a value computed based on its Value).
In GUIDE, I would do this using the UserData propery, however, the App Designer GUI provides only the "Tag" property from the Identifiers section.
If I inspect the object in code I can see that there is a UserDate property available for the slider:
Position: [50 522 693 3]
Tag: ''
Tooltip: '30.5px'
Type: 'uislider'
UserData: []
Value: 0.3000
ValueChangedFcn: ''
ValueChangingFcn: @(source,event)executeCallback(ams,app,callback,requiresEventData,event)
Visible: on
I was thinking that I can initialize the UserData in the CreateFcn of the slider - but the slider comes only with ValueChangedFcn and ValueChangingFcn.
So how can I set an initial value to the UserData?
I'm using Matlab R2023a.
3 Kommentare
Akzeptierte Antwort
Voss
am 24 Feb. 2025
You can initialize the slider's UserData in the app's StartupFcn.
4 Kommentare
Voss
am 24 Feb. 2025
You're welcome!
You can make an enhancement request as follows: https://www.mathworks.com/matlabcentral/answers/460998-how-can-i-make-a-features-request#answer_374172
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
