checking dialog box that gathers user input
이전 댓글 표시
I want to create a dialog box for user to input at the beginning of my GUI (not showing the GUI page). When the user input is integer, GUI page will show and go on. When the user input is not integer, a warning dialog will show and require user to input again until he input the integer. My code is here:
prompt = {'Enter number of Day:','Enter number of Month:'};
dlg_title = 'Input';
num_lines = 1;
defaultans = {' ',' '};
answer = inputdlg(prompt,dlg_title,num_lines,defaultans);
if ~all(ismember(answer, '.1234567890'))
uiwait(warndlg('Please enter an integer!','!! Warning !!'))
end
Where should I put these coding? As I put them before "Begin initialization code", the dialog will occur repeatedly when I execute other button in GUI. I also can not let user input again after the warning occurred. Can you please tell me why???
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Performance and Memory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!