Text-only
Table of Contents (
frame
/
no frame
)
(22) Types of Matlab Functions
Types of Matlab Functions
Subfunctions
contained in m-file of a primary function
callable only by primary functions and other subfunctions in that file
does not share workspace of the primary function
Private Functions
reside in subdirectory with special name private
visible only to functions in the parent directory
useful when overriding another function with the same name
Nested Functions
defined within the body of another function
has its own workspace
has access to the workspace of the function(s) that it is nested within
Function Handles
used in calling functions indirectly
often used when passing a function name as an input to another function
handle= @functionname
Anonymous Functions
simple function which does not require an M-file
single matlab expression with inputs and outputs
f = @(arglist) expression
Function_Details2.src last modified Oct 17, 2007
Introduction
Table of Contents
(
frame
/
no frame
)
Printable
(single file)
© Dartmouth College