23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Symbol Reference<br />

Function Input Arguments<br />

When parentheses follow a function name in a function declaration or call, the<br />

enclosed list contains input arguments used by the function:<br />

function sendmail(to, subject, message, attachments)<br />

Percent — %<br />

The percent sign is most commonly used to indicate nonexecutable text within<br />

the body of a program. This text is normally used to include comments in your<br />

code. Some functions also interpret the percent sign as a conversion specifier.<br />

See “Help Text” on page 4-12 for more information.<br />

Single Line Comments<br />

Precede any one-line comments in your code with a percent sign. <strong>MATLAB</strong><br />

does not execute anything that follows a percent sign (that is, unless the<br />

sign is quoted, '%'):<br />

% The purpose of this routine is to compute<br />

% the value of ...<br />

Conversion Specifiers<br />

Some functions, like sscanf and sprintf, precede conversion specifiers with<br />

the percent sign:<br />

sprintf('%s = %d', name, value)<br />

Percent-Brace — %{ %}<br />

The %{ and %} symbols enclose a block of comments that extend beyond one<br />

line.<br />

Block Comments<br />

Enclose any multiline comments with percent followed by an opening or<br />

closing brace.<br />

%{<br />

3-105

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

Saved successfully!

Ooh no, something went wrong!