fp
::nestvals
Repeated composition returning intermediate values
MuPAD® notebooks will be removed in a future release. 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::nestvals(f
, n
)
fp::nestvals(f, n)
returns a function which
applies the function f
n
-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.
Apply f
3 times nested to x
:
fp::nestvals(f, 3)(x)
Apply cos
4
times nested to 1.0
and return the result and intermediate
values:
fp::nestvals(cos, 4)(1.0)
|
Function |
|
Nonnegative integer |
Function.