How to resolve empty inputdlg box issue?
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
John Doe
am 12 Jul. 2020
Kommentiert: Star Strider
am 21 Mai 2023
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 Kommentare
Akzeptierte Antwort
Star Strider
am 12 Jul. 2020
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 Kommentare
Mpho
am 21 Mai 2023
Hi, thanks for the helpful answer. Could you please explain what the colon does?
Star Strider
am 21 Mai 2023
My pleasure!
Weitere Antworten (0)
Siehe auch
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!