Documentation

This is machine translation

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

fp::nestvals

Repeated composition returning intermediate values

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.

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?