Programming and Data Types    

Displaying Function Handle Information

The 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.

Field Name
Field Description
Function name.
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 'MATLAB built-in function.'
All overloaded methods of the function that are bound to the function handle. This field exists only for functions of type, overloaded.

For example, to obtain information on a function handle for the display function,

Individual fields of the structure are accessible using the dot selection notation used to access MATLAB structure fields.

The 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.

  Examples of Function Handle Evaluation Fields Returned by the Functions Command