How to set handles on multiple figures using loop?

2 Ansichten (letzte 30 Tage)
acosep
acosep am 26 Sep. 2015
Kommentiert: acosep am 2 Okt. 2015
for
set(handles.edit(from 1 to 100),'Visible','off')
end

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 26 Sep. 2015
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 Kommentare
Walter Roberson
Walter Roberson am 26 Sep. 2015
Aggh! Use dynamic field names not eval()
set(handles.(sprintf('edit%d', i)), 'visible', 'off')
acosep
acosep am 2 Okt. 2015
Why? Ok then.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by