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.

3 Basic Program Components<br />

Cell Array Indexing<br />

Index to a specific cell array element by enclosing all indices in curly braces:<br />

A = C{4,7,2}<br />

See “Cell Arrays” on page 2-94 for more information.<br />

Dot — .<br />

The single dot operator has the following different uses in <strong>MATLAB</strong>.<br />

Structure Field Definition<br />

Add fields to a <strong>MATLAB</strong> structure by following the structure name with a<br />

dot and then a field name:<br />

funds(5,2).bondtype = 'Corporate';<br />

See “Structures” on page 2-75 for more information.<br />

Object Method Specifier<br />

Specify the properties of an instance of a <strong>MATLAB</strong> class using the object<br />

name followed by a dot, and then the property name:<br />

val = asset.current_value<br />

See “<strong>MATLAB</strong> Classes” on page 2-118 for more information.<br />

Dot-Dot — ..<br />

Two dots in sequence refer to the parent of the current directory.<br />

Parent Directory<br />

Specify the directory immediately above your current directory using two<br />

dots. For example, to go up two levels in the directory tree and down into the<br />

testdir directory, use<br />

cd ..\..\testdir<br />

3-102

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

Saved successfully!

Ooh no, something went wrong!