Create error dialog box
f = errordlg(
creates a nonmodal
error dialog box with the specified error message and returns the dialog box
msg
)Figure
object f
. The message text wraps to
fit the dialog box.
Use the errordlg
function if you want to show an error dialog
box over multiple app windows, the MATLAB® desktop, or Simulink® and still be able to interact with them before responding to the
dialog box.
f = errordlg
creates an error dialog box with a default title
and message as follows.
Default title: Error Dialog
Default message: This is
the default error.
Modal
dialogs (created using errordlg
, msgbox
, or warndlg
)
replace any existing dialogs created with these functions that also
have the same name.
MATLAB program execution continues
even when a modal Error dialog box is active. To block program execution until
the user closes the dialog box, use the uiwait
function.
To create a modal
alert dialog box for single-window App Designer or
uifigure
-based apps, use the uialert
function
instead.