warning
R2026bDisplay and manage warning
Syntax
Description
Display Warning
warning( displays a warning
message msg)msg and sets the value returned by the
lastwarn function. If msg is empty,
warning("") resets lastwarn without
displaying any text.
warning(
attaches a warning identifier to the warning message. You can include any of the
input arguments in the previous syntaxes. You can distinguish warnings and
control their states (enable or disable) using warning identifiers.warnID,___)
Manage Warning
warning displays the states of all warnings.
returns a
structure array that contains information about the current states of warnings.
Each element in warnStruct = warningwarnStruct includes an
identifier field with a warnID or
"all", and a state field that
indicates whether the warning is disabled or enabled.
warning( sets the states
of warnings specified in warnStruct)warnStruct.
Control Display
controls whether MATLAB displays the stack trace or additional information by setting the
specified modeStruct = warning(state,mode)mode to state. The optional
return structure modeStruct contains information about the
previous mode state.
warning( sets the mode
state specified in modeStruct)modeStruct.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced before R2006a