Note: Use only in the MuPAD Notebook Interface. This functionality does not run in MATLAB.
The functions of the
fp package are higher
order functions and other utilities useful for functional programming.
Some other functions useful for functional programming are already
contained in the MuPAD® standard library, like
For a more detailed description of concepts like "higher order function", "currying" and "fixed points" see for example the textbook "Computability, Complexity and Languages" by M. Davis, R. Sigal, and E. J. Weyuker, Academic Press (1994).
Most of the functions of the
fp package take
functions as arguments and return other functions. In this context
a function may be a functional environment, a procedure, a kernel
function or any other object which may be regarded as a function (i.e.
applied to arguments). Note that almost all MuPAD objects are
functions in this sense.
The rational integer
2/3 for example may
be regarded as a constant function returning the value
[sin, cos, 2/3] may be regarded
as a unary function mapping
[sin, cos, 2/3](x)
The library functions are called in the form
By this mechanism, naming conflicts with other library functions are
avoided. If this is found to be too awkward the methods of the
may be exported. After calling
use(fp, fixedpt) the
fixedpt is also directly available, i.e.
also be called. If a variable with the name
an error. The value of the identifier
then be deleted in order to be exported. With
methods of the
fp package are exported.