How to programmatically change the label text of a matlab.ui.control.Knob (or other ui.conntrol)
25 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Allen Goldstein
am 22 Feb. 2021
Kommentiert: Allen Goldstein
am 22 Feb. 2021
I have a set of knobs that need to have the label changed depending on what they are controlling. But it seems the label text creates the controls name itself. For example if the knob is labeled "M" then the name is app.MKnob. I want the user to sometimes see the knob called "B" and at other times see it called "M".
There does not seem to be any property to change the label text and I cannot use tlabel = uilabel(app.MKnob) because the uicontrol cannot be a parent.
Seems like there should be s simple way to programmatically change the label that the user sees for a uicontrol.
0 Kommentare
Akzeptierte Antwort
Mario Malic
am 22 Feb. 2021
Hi,
Knob component actually consists of two components. If you right click on Component browser, there's an option to include component labels.
app.Knob % the component
app.KnobLabel.Text % returns the text associated with the knob
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Migrate GUIDE Apps 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!