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.

4 M-File <strong>Programming</strong><br />

Call plotFhandle with a handle to the sin function and the value shown<br />

below:<br />

plotFHandle(@sin, -pi:0.01:pi)<br />

Functions That Operate on Function Handles<br />

<strong>MATLAB</strong> provides the following functions for working with function handles.<br />

See the reference pages for these functions for more information.<br />

Function<br />

functions<br />

func2str<br />

str2func<br />

save<br />

load<br />

isa<br />

isequal<br />

Description<br />

Return information describing a function handle.<br />

Construct a function name string from a function<br />

handle.<br />

Construct a function handle from a function name<br />

string.<br />

Save a function handle from the current workspace to<br />

aMAT-file.<br />

Load a function handle from a MAT-file into the current<br />

workspace.<br />

Determine if a variable contains a function handle.<br />

Determine if two function handles are handles to the<br />

same function.<br />

Comparing Function Handles<br />

This section describes how <strong>MATLAB</strong> determines whether or not separate<br />

function handles are equal to each other:<br />

• “Handles Constructed from a Named Function” on page 4-27<br />

• “Handles to Anonymous Functions” on page 4-27<br />

• “Handles to Nested Functions” on page 4-28<br />

• “HandlesSavedtoaMAT-File”onpage4-29<br />

4-26

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

Saved successfully!

Ooh no, something went wrong!