App Designer - increment component
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Monisha Nalluru
2021-4-12
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!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!