|Programming and Data Types|
Displaying Function Handle Information
functions command returns information about a function handle that might be useful for debugging. Calling
functions on a function handle returns the function name, type, filename, and all of the methods for the function that were in scope at the time the function handle was created.
The information returned from
functions is in the form of a MATLAB structure. The fields of this structure are listed in the following table.
||Function type. See the table in Function Type.
||The file to be executed when the function handle is evaluated with a nonoverloaded data type. For built-in functions, it reads '
||All overloaded methods of the function that are bound to the function handle. This field exists only for functions of type,
For example, to obtain information on a function handle for the
Individual fields of the structure are accessible using the dot selection notation used to access MATLAB structure fields.
methods field is a separate structure containing one fieldname for each class that overloads the function. The value of each field is the path and name of the file that defines the function.
f.methods ans = polynom: '\home\user4\@polynom\display.m' inline: 'matlabroot\toolbox\matlab\funfun\@inline\display.m' serial: 'matlabroot\toolbox\matlab\iofun\@serial\display.m' avifile: 'matlabroot\toolbox\matlab\iofun\@avifile\display.m' f.methods.polynom ans = polynom: '\home\user4\@polynom\display.m'
|Examples of Function Handle Evaluation||Fields Returned by the Functions Command|