Quantcast

Documentation Center

  • Trial Software
  • Product Updates

fp::nestvals

Repeated composition returning intermediate values

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

fp::nestvals(f, n)

Description

fp::nestvals(f, n) returns a function which applies the function fn-fold repeatedly to its argument and returns the intermediate n + 1 values as a list.

Thus fp::nestvals returns the function

The function returned is equivalent to [_fnest(f,i) $i=0..n], but more efficient.

Examples

Example 1

Apply f 3 times nested to x:

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

Example 2

Apply cos 4 times nested to 1.0 and return the result and intermediate values:

fp::nestvals(cos, 4)(1.0)

Parameters

f

Function

n

Nonnegative integer

Return Values

Function.

See Also

MuPAD Functions

Was this topic helpful?