msgbox

Displays a dialog box with the message s.

Syntax

msgbox(s)

R = msgbox(s, c)

R = msgbox(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)
The caption to be displayed for the dialog.
Type: string
dummyarg
Optional dummy argument for compatibility with legacy scripts.

Outputs

R
Type: integer

Examples

String input:
R = msgbox('This is a message!!!')

R = 1
Content displayed in the dialog is 'This is a message!!!'
String input with newline and caption:
R = msgbox('Message line 1\nMessage line 2', 'My Message')

R = 1
Content displayed in the dialog with the caption 'My Message' is
'Message line 1'
'Message line 1'
Cell input:
R = msgbox({'This', ' is', ' a', ' message!!!'})

R = 1
Content displayed in the dialog is 'This is a message!!!'