counting number of textbox or patches in a matlab figure

1 次查看(过去 30 天)
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?

回答(1 个)

Jan
Jan 2020-8-25
编辑:Jan 2020-8-25
% All text boxes:
List1 = findall(HandleOfFigure, 'Type', 'uicontrol', 'Style', 'text')
Count1 = numel(List1)
% All patches:
List2 = findall(HandleOfFigure, 'Type', 'patch')
Count2 = numel(List2)

类别

Help CenterFile Exchange 中查找有关 Polygons 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by