Referring to object names in App Designer as elements of an array
Afficher commentaires plus anciens
In App Designer, I want to introduce the names of a series of objects (e.g. uifigures) in an array, and then refer to them by their index. For example:
PlotNames={'app.XY1' 'app.XY2' 'app.XY3'}
for iPN=1:length(PlotNames)
plot(PlotNames{iPN},X(iPN),Y(iPN))
end
but when I do this I get the error: 'Invalid first data argument.'
Is it possible to refer to object names in App Designer as elements of an array?
Réponse acceptée
Plus de réponses (1)
Steven Lord
le 30 Juil 2024
1 vote
You can access properties of an object using a variable name using the syntax shown in the Reference Properties Using Variables section on this documentation page.
Catégories
En savoir plus sur Develop Apps Programmatically dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!