Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

warndlg - Open warning dialog box

Syntax

h = warndlg
h = warndlg(warningstring)
h = warndlg(warningstring,dlgname)
h = warndlg(warningstring,dlgname,createmode)

Description

h = warndlg displays a dialog box named Warning Dialog containing the string This is the default warning string. The warndlg function returns the handle of the dialog box in h. The warning dialog box disappears after the user clicks OK.

h = warndlg(warningstring) displays a dialog box with the title Warning Dialog containing the string specified by warningstring. The warningstring argument can be any valid string format – cell arrays are preferred.

To use multiple lines in your warning, define warningstring using either of the following:

h = warndlg(warningstring,dlgname) displays a dialog box with title dlgname.

h = warndlg(warningstring,dlgname,createmode) specifies whether the warning dialog box is modal or nonmodal. Optionally, it can also specify an interpreter for warningstring and dlgname. The createmode argument can be a string or a structure.

If createmode is a string, it must be one of the values shown in the following table.

createmode ValueDescription
modal

Replaces the warning dialog box having the specified Title, that was last created or clicked on, with a modal warning dialog box as specified. All other warning dialog boxes with the same title are deleted. The dialog box which is replaced can be either modal or nonmodal.

non-modal (default)

Creates a new nonmodal warning dialog box with the specified parameters. Existing warning dialog boxes with the same title are not deleted.

replace

Replaces the warning dialog box having the specified Title, that was last created or clicked on, with a nonmodal warning dialog box as specified. All other warning dialog boxes with the same title are deleted. The dialog box which is replaced can be either modal or nonmodal.

If CreateMode is a structure, it can have fields WindowStyle and Interpreter. WindowStyle must be one of the options shown in the table above. Interpreter is one of the strings 'tex' or 'none'. The default value for Interpreter is 'none'.

Examples

The statement

warndlg('Pressing OK will clear memory','!! Warning !!')

displays this dialog box:

See Also

dialog, errordlg, helpdlg, inputdlg, listdlg, msgbox, questdlg

figure, uiwait, uiresume, warning

Predefined Dialog Boxes for related functions

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS