How to reference past values?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
how do I reference past values of a function?
as in f(x) = 0.7*(f(x-1))
0 Kommentare
Antworten (1)
Roger Wohlwend
am 16 Okt. 2014
Bearbeitet: Roger Wohlwend
am 16 Okt. 2014
In general you have to use a loop for that. However, in your simple case it is not necessary.
f(x) = 0.7^x * f(0)
where f0 is the inition condition.
So if you want a vector with the first n values of the function, use the following Matlab code:
f = 0.7.^(1:n) * f0
where f0 is the initial condition, a scalar.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!