How to resolve empty inputdlg box issue?
8 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone!
I have a inputdlg box. I want the inputdlg box to cancel the processing if the user pressed OK without giving any input in the inputdlg box. How can I do that?
I know how to cancel the processing if Cancel or the close button is pressed.
Thanks in advance!
0 件のコメント
採用された回答
Star Strider
2020 年 7 月 12 日
Try this:
a = inputdlg('Type a number:')
if isempty(a{:})
disp('a is empty') % Information Only To Demonstrate That The Test Works
return
end
fprintf('a = %f\n', str2double(a))
.
2 件のコメント
Mpho
2023 年 5 月 21 日
Hi, thanks for the helpful answer. Could you please explain what the colon does?
Star Strider
2023 年 5 月 21 日
My pleasure!
その他の回答 (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!