counting number of textbox or patches in a matlab figure

1 visualizzazione (ultimi 30 giorni)
Is there a programmable method to count the number of patches or textboxes there are in a given figure, and then put the number in an array?

Risposte (1)

Jan
Jan il 25 Ago 2020
Modificato: Jan il 25 Ago 2020
% All text boxes:
List1 = findall(HandleOfFigure, 'Type', 'uicontrol', 'Style', 'text')
Count1 = numel(List1)
% All patches:
List2 = findall(HandleOfFigure, 'Type', 'patch')
Count2 = numel(List2)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by