Reset GUI Edit Text Field to Empty String
4 ビュー (過去 30 日間)
古いコメントを表示
Rachel McMurphy
2019 年 10 月 27 日
コメント済み: Walter Roberson
2020 年 2 月 6 日
I have a reset button on my app, and 5 edit field (text) for various inputs. When pressing the reset button, it's supposed to clear the 5 text boxes to empty strings. I've tried other suggestions from other questions (like using 'set' and 'findobj') but none of them have worked. My professor said to create a string first, then set it to empty with our code, and test it with 'isempty' but he gave no further explanation.
4 件のコメント
Walter Roberson
2020 年 2 月 6 日
set( findobj(gcf, 'type', 'uicontrol', 'style', 'text'), 'string', '')
採用された回答
Walter Roberson
2019 年 10 月 27 日
app.edit1.Value = '';
app.edit2.Value = '';
app.edit3.Value = '';
app.edit4.Value = '';
app.edit5.Value = '';
if isempty(app.edit3.Value)
disp('Yes it is empty');
else
disp('No it is not empty');
end
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!