Dialog dialog box
Syntax:
H = Dialog ('propertyname', propertyvalue ,...)
Default properties of the dialog box
Windowstyle value: {normal} | modal | docked
Detailed instance:
Out = dialog; % after the default dialog box is displayed, click the blank dialog box in the dialog box to close it.
Result:
% Normal dialog box
Out = Dialog ('windowstyle', 'normal ',...
'Name', 'My dialog dialogs ',...
'Position', [300 300 400 300]);
Uicontrol ('parent', out ,...
'Style', 'pushutton ',...
'Position', [80 40 80 50],...
'String', 'OK ',...
'Callback', 'delete (gcb') '); % callback function, click the button to close the dialog box
Result: (click the button to close the dialog box)
Error dialog box errordlg
Syntax:
H = errordlg
H = errordlg (errorstring)
H = errordlg (errorstring, dlgname)
H = errordlg (errorstring, dlgname, createmode)
% Createmode value: Non-modal (default), modal, replace
Example:
H = errordlg ('Dialog box content', 'Dialog box title', 'modal ')
Warndlg warning dialog box (similar to the error dialog box)
Syntax:
H = warndlg
H = warndlg (warningstring)
H = warndlg (warningstring, dlgname)
H = warndlg (warningstring, dlgname, createmode)
Example:
Warndlg ('pressing OK will clear memory ','!! Warning !! ')
Result:
Matlab learning ------------ normal dialog box, error dialog box errordlg, warning dialog box warndlg