23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Warning Control<br />

Field Name<br />

identifier<br />

state<br />

Description<br />

Message identifier string, 'all', or'last'<br />

State of warning(s) prior to invoking this control<br />

statement<br />

If you query for the state of just one warning, using a message identifier or<br />

'last' in the command, then <strong>MATLAB</strong> returns a one-element structure<br />

array. The identifier field contains the selected message identifier and the<br />

state field holds the current state of that warning:<br />

s = warning('query','last')<br />

s =<br />

identifier: '<strong>MATLAB</strong>:divideByZero'<br />

state: 'on'<br />

If you query for the state of all warnings, using 'all' in the command,<br />

<strong>MATLAB</strong> returns a structure array having one or more elements:<br />

• The first element of the array always represents the default state. (This is<br />

the state set by the last warning on|off all command.)<br />

• Each other element of the array represents a warning that is in a state<br />

that is different from the default.<br />

warning off all<br />

warning on <strong>MATLAB</strong>:divideByZero<br />

warning on <strong>MATLAB</strong>:fileNotFound<br />

s = warning('query', 'all')<br />

s =<br />

3x1 struct array with fields:<br />

identifier<br />

state<br />

s(1)<br />

ans =<br />

identifier: 'all'<br />

state: 'off'<br />

8-21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!