Question: In Matlab, how can I check if a function descriptor is a specific function or function type?
Example: Let f1 be a function descriptor. How to check if there is f1 built-in Matlab mean function? How to check if f1 an anonymous function?
My current solution: My current solution to this problem is to call the functions functions . functions accepts the function descriptor as input and returns a structure containing information about the descriptor of the input function, for example, function type, path, function name, etc. It works, but this is not an ideal solution, because, quoting :
"Caution MATLAB® only provides functions for queries and debugging. Since its behavior may change in future releases, you should not rely on it for programming purposes."
matlab function-handle
Colin t bowers
source share