Creating empty ui control component
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Bruno Pilon
am 22 Dez. 2020
Kommentiert: Bruno Pilon
am 22 Dez. 2020
When using appdesigner, I want to initialize a property as an array of labels and text area
properties (Access = private)
comp_ui_obj
end
function startupFcn(app)
app.comp_ui_obj(1) = app.CompLabel;
% 2..n assignments here
end
The problem is that the declaration of comp_ui_obj is by default double. Because of this app.comp_ui_obj(1) will contain a double instead of a matlab.ui.control object.
So, it seems that app.comp_ui_obj needs to be initialized as an empty matlab.ui.control object before the assignment.
With some classes, the empty function can be used for this (ex: uint8.empty). However, matlab.ui.control.empty does not work.
So, how do we initialize an empty ui control in appdesigner? How do we initialize a vector of empty elements?
1 Kommentar
Cris LaPierre
am 22 Dez. 2020
Could you provide more detail on why you are wanting to do this? What is the need driving this workflow?
Akzeptierte Antwort
Cris LaPierre
am 22 Dez. 2020
Try setting your property to an empty Label class using the following
comp_ui_obj = matlab.ui.control.Label.empty
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Desktop finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!