This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Repeated composition of function

MuPAD® notebooks are not recommended. 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::nest(f, n)


fp::nest(f,n) returns the n-fold repeated composition of the function f.

Thus, given the function f, fp::nest returns the identity function id if n is 0 and otherwise the function

n-fold repeated.

Note that fp::nest is obsolete, one should use the @@ operator or its functional form _fnest instead. It is only supported for compatibility with former versions of MuPAD®.


Example 1

Apply the 3-fold repeated composition of f to x:

fp::nest(f, 3)(x)

Example 2

Numerically finding a fixed point of the function cos by repeated application:

p :=fp::nest(cos, 100)(1.0):
p, cos(p)





Nonnegative integer

Return Values


See Also

MuPAD Functions

Was this topic helpful?