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.

How <strong>MATLAB</strong> Determines Which Method to Call<br />

2 MEX-files<br />

3 MDL (Simulink® model) file<br />

4 P-code file<br />

5 M-file<br />

For example, if <strong>MATLAB</strong> finds a P-code and an M-file version of a method in a<br />

class directory, then the P-code version is used. It is, therefore, important to<br />

regenerate the P-code version whenever you edit the M-file.<br />

Querying Which Method <strong>MATLAB</strong> Will Call<br />

You can determine which method <strong>MATLAB</strong> will call using the which<br />

command. For example,<br />

which pie3<br />

your_matlab_path/toolbox/matlab/specgraph/pie3.m<br />

However, if p is a portfolio object,<br />

which pie3(p)<br />

dir_on_your_path/@portfolio/pie3.m<br />

% portfolio method<br />

The which command determines which version of pie3 <strong>MATLAB</strong> will call<br />

if you passed a portfolio object as the input argument. To see a list of all<br />

versions of a particular function that are on your <strong>MATLAB</strong> path, use the -all<br />

option. See the which reference page for more information on this command.<br />

9-75

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

Saved successfully!

Ooh no, something went wrong!