App Designer - increment component
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Marc Servagent
am 9 Apr. 2021
Kommentiert: Marc Servagent
am 13 Apr. 2021
Hello,
I try to increment the name of a component in app designer, in order to create a loop,
hereafter an example:
for i=1:8
app.Lamp.Color_i = [0 0 0]
end
Of course, the above example does not work, I tryed several type of concantenate functions, and also eval function, but I did not succed.
Thanks in advance for any help !
0 Kommentare
Akzeptierte Antwort
Monisha Nalluru
am 12 Apr. 2021
If uilamps are named as Lamp1, Lamp2, Lamp3 and so on.
Then you can access them using the following statement
for i=1:8
app.("Lamp"+i).Color = "red";
end
Hope this helps!
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!