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???
Best Answer