title: Matlab - Check if function handle is a particular function or function type
body: <p><strong>Question:</strong> In Matlab, how can I check if a function handle is a particular function or function type?</p>
  
  <p><strong>Example:</strong> Let <code>f1</code> be a function handle. How do I check if <code>f1</code> is the in-built Matlab function <code>mean</code>? How do I check if <code>f1</code> is an anonymous function?</p>
  
  <p><strong>My Current Solution:</strong> My current solution to this problem involves a call to the <code>functions</code> function. <code>functions</code> accepts a function handle as input and returns a structure containing information about the input function handle, eg function type, path, function name etc. It works, but it is not an ideal solution because, to quote the <a href="http://www.mathworks.com.au/help/matlab/matlab_prog/advanced-operations-on-function-handles.html">official documentation</a>: </p>
  
  <p>"Caution MATLAB® provides the <code>functions</code> function for querying and debugging purposes only. Because its behavior may change in subsequent releases, you should not rely upon it for programming purposes."</p>