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.

Symbol Reference<br />

Dot-Dot-Dot (Ellipsis) — ...<br />

A series of three consecutive periods (...) is the line continuation operator in<br />

<strong>MATLAB</strong>. This is often referred to as an ellipsis, but it should be noted that<br />

the line continuation operator is a three-character operator and is different<br />

from the single-character ellipsis represented in ASCII by the hexadecimal<br />

number 2026.<br />

Line Continuation<br />

Continue any <strong>MATLAB</strong> command or expression by placing an ellipsis at the<br />

end of the line to becontinued:<br />

sprintf('The current value of %s is %d', ...<br />

vname, value)<br />

Entering Long Strings. You cannot use an ellipsis within single quotes<br />

to continue a string to the next line:<br />

string = 'This is not allowed and will generate an ...<br />

error in <strong>MATLAB</strong>.'<br />

To enter a string that extends beyond a single line, piece together shorter<br />

strings using either the concatenation operator ([]) orthesprintf function.<br />

Here are two examples:<br />

quote1 = [<br />

'Tiger, tiger, burning bright in the forests of the night,' ...<br />

'what immortal hand or eye could frame thy fearful symmetry?'];<br />

quote2 = sprintf('%s%s%s', ...<br />

'In Xanadu did Kubla Khan a stately pleasure-dome decree,', ...<br />

'where Alph, the sacred river, ran ', ...<br />

'through caverns measureless to man down to a sunless sea.');<br />

Dot-Parentheses —.()<br />

Use dot-parentheses to specify the name of a dynamic structure field.<br />

3-103

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

Saved successfully!

Ooh no, something went wrong!