How to get graphics array content App Designed
2 次查看(过去 30 天)
显示 更早的评论
I have in a parent panel 4 push buttons and 2 children panels like this:
The number of children panels can vary, so I would like to read how many panels are. If I execute the command:
app.<Parent panel name>.Children, I get a graphics array of 6x1 (2=panels + 4=push buttons). Like this:
How can I read this cell array? Some equivalent to strcmp(ParentPanel,'Panel') to get an answer of an array like ([1 0 0 0 0 1]) and easily know with find command which members of the array are panels?
Thanks you in advance!
0 个评论
采纳的回答
更多回答(1 个)
Steven Lord
2024-2-1
Rather than searching for the panels after the fact, I'd probably create a property of your app that can contain a vector of handles to the panels.
When you create a panel, store its handle in that property.
If you delete a panel, remove it from that property.
When you need to operate on the panels, get that property and select the appropriate handle or handles from the vector.
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!