How to set handles on multiple figures using loop?

조회 수: 19 (최근 30일)
acosep
acosep 2015년 9월 26일
댓글: acosep 2015년 10월 2일
for
set(handles.edit(from 1 to 100),'Visible','off')
end

채택된 답변

Walter Roberson
Walter Roberson 2015년 9월 26일
set(handles.edit(1:100),'Visible','off')
Question: is handles.edit vector of length 100, or do you have handles.edit1, handles.edit2, handles.edit3, and so on up to 100? If you do, then are those handles the only uicontrol of style edit or are there a small number of others or are there a bunch of others?
  댓글 수: 5
Walter Roberson
Walter Roberson 2015년 9월 26일
Aggh! Use dynamic field names not eval()
set(handles.(sprintf('edit%d', i)), 'visible', 'off')
acosep
acosep 2015년 10월 2일
Why? Ok then.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by