errordlg

Displays a dialog box with the error s.

Syntax

errordlg(s)

R = errordlg(s, c)

R = errordlg(s, c, dummyarg)

Inputs

s
Content to display in the dialog. String inputs can have the '\n' newline character, which are displayed on separate lines of the dialog. String elements of cell inputs will be displayed on new lines in the dialog.
Type: string | cell
c (optional)
Specifies the caption to be displayed for the dialog. If no caption is specified, the caption displayed will be 'Error'.
Type: string
dummyarg (optional)
Dummy argument for compatibility with legacy scripts.

Outputs

R
Type: integer

Examples

String input:
R = errordlg('This is an error!!!')
        
R = 1
Content displayed in the dialog is 'This is an error!!!'
String input with a newline and caption:
R = errordlg('Error line 1\nError line 2', 'My Error')

R = 1
Content displayed in the dialog with caption 'My Error' is
'Error line 1'
'Error line 1'
Cell input:
R = errordlg({'This', ' is', ' an', ' error!!!'})

R = 1
Content displayed in the dialog is 'This is an error!!!'