Curry an n-ary function
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
fp::curry(f) returns the higher-order function .
fp::curry returns the curried version of
f. If no
n is given, then the function is assumend
to be binary.
n is smaller than 2 then
returned. Otherwise, given a n-ary
Create curried versions of binary and 3-nary functions:
cf := fp::curry(f): cf(x)(y)
cg := fp::curry(g, 3): cg(x)(y)(z)
A curried version of
_plus may be used to
create a function which increments its argument by
inc := fp::curry(_plus)(1): inc(x)
Unary higher-order function.