MATLAB Function Reference    

Create and display an error dialog box



errordlg creates an error dialog box, or if the named dialog exists, errordlg pops the named dialog in front of other windows.

errordlg displays a dialog box named 'Error Dialog' that contains the string 'This is the default error string.'

errordlg('errorstring') displays a dialog box named 'Error Dialog' that contains the string 'errorstring'.

errordlg('errorstring','dlgname') displays a dialog box named 'dlgname' that contains the string 'errorstring'.

errordlg('errorstring','dlgname','on') specifies whether to replace an existing dialog box having the same name. 'on' brings an existing error dialog having the same name to the foreground. In this case, errordlg does not create a new dialog.

h = errordlg(...) returns the handle of the dialog box.


MATLAB sizes the dialog box to fit the string 'errorstring'. The error dialog box has an OK pushbutton and remains on the screen until you press the OK button or the Return key. After pressing the button, the error dialog box disappears.

The appearance of the dialog box depends on the windowing system you use.


The function

displays this dialog box:

See Also

dialog, helpdlg, msgbox, questdlg, warndlg

Predefined Dialog Boxes for related functions

  errorbar etime