counting number of textbox or patches in a matlab figure

조회 수: 1 (최근 30일)
gummiyummi
gummiyummi 2020년 8월 25일
댓글: gummiyummi 2020년 8월 25일
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)
  댓글 수: 1
gummiyummi
gummiyummi 2020년 8월 25일
I get the following error:
"Undefined function or variable 'HandleOfFigure'

댓글을 달려면 로그인하십시오.

카테고리

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