Modify multiple GUIDE Tags in code

1 回表示 (過去 30 日間)
Douglas Anderson
Douglas Anderson 2018 年 1 月 3 日
コメント済み: Douglas Anderson 2018 年 1 月 3 日
Hello,
I would like to modify 18 GUIDE edit text boxes. The default names are edit1, edit2, edit3... Is there a way to access each of them (modifying the Strings, getting the values, etc.) in a loop? Eventually getting the input into an array.
I partially recall something with "eval" that would then be fed to the "set(handles.editX,'String','0')" or whatever, changing the "editX" to the correct number, but not enough to make this work.
Thanks.
Doug
  2 件のコメント
Adam
Adam 2018 年 1 月 3 日
編集済み: Adam 2018 年 1 月 3 日
hEdit = gobjects(1,18); % Only available in R2013a or later
for n = 1:18
hEdit(n) = handles.( [ 'edit', num2str(n) ] );
end
will gather them all into an array for you so you can then just refer to them by index.
Douglas Anderson
Douglas Anderson 2018 年 1 月 3 日
Wow!!!
Thank you, Adam.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by