fp::nest

Repeated composition of function

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

fp::nest(f, n)

Description

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®.

Examples

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)

Parameters

f

Function

n

Nonnegative integer

Return Values

Function.

See Also

MuPAD Functions

Was this topic helpful?