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.

3 Basic Program Components<br />

Keywords<br />

<strong>MATLAB</strong> reserves certain words for its own use as keywords of the language.<br />

To list the keywords, type<br />

iskeyword<br />

ans =<br />

'break'<br />

'case'<br />

'catch'<br />

'continue'<br />

'else'<br />

'elseif'<br />

'end'<br />

'for'<br />

'function'<br />

'global'<br />

'if'<br />

'otherwise'<br />

'persistent'<br />

'return'<br />

'switch'<br />

'try'<br />

'while'<br />

See the online function reference pages to learn how to use these keywords.<br />

You should not use <strong>MATLAB</strong> keywords other than for their intended purpose.<br />

For example, a keyword should not be used as follows:<br />

while = 5;<br />

??? while = 5;<br />

|<br />

Error: Expected a variable, function, or constant, found "=".<br />

3-14

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

Saved successfully!

Ooh no, something went wrong!