How to get graphics array content App Designed
3 views (last 30 days)
Show older comments
Joannes Olondriz Erdozain
on 1 Feb 2024
Answered: Steven Lord
on 1 Feb 2024
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 Comments
Accepted Answer
More Answers (1)
Steven Lord
on 1 Feb 2024
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 Comments
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!