Search code examples
matlabfunctional-programmingcurryingarity

Determine the arity of a function handle and currying


Is there any way to determine the arity of a function and/or curry functions in MATLAB? I can't find any documentation on the matter.


Solution

  • Are you looking for nargin?

    For example,

    >> nargin('genvarname')
    
    ans =
    
         2
    

    i.e. the function genvarname has an arity of 2