FUNCTION REFERENCE

warning

Display a warning and continue.

Display a warning and continue.

Syntax

warning(msg)

Syntax

warning(msg, A1, ...)

Syntax

warning(id, msg, A1, ...)

Syntax

warning('off', id)

Syntax

warning('on', 'all')

Syntax

s = warning('off', id)

Syntax

s = warning('query', id)

Syntax

s = warning

Syntax

warning(s)

Prints "Warning: " and the message (formatted like error() when there are

extra arguments) and continues. warning('off', id) silences that identifier

for the session, warning('off', 'all') silences all warnings, and 'on' turns

them back on. Assigning the result of 'on' or 'off' saves the previous state.

Query an identifier with warning('query', id), or query all states with

warning. Queries print the state or return it when assigned. Pass a saved

state to warning(s) to restore it.

Example

warning('Value %d is large', 7)   % Warning: Value 7 is large

Differences from MATLAB: the warning is one line without the "> In" location

lines. The 'backtrace' and 'verbose' options are unavailable.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.