How to reference past values?

Réponses (1)

Roger Wohlwend
Roger Wohlwend le 16 Oct 2014
Modifié(e) : Roger Wohlwend le 16 Oct 2014

0 votes

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.

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Tags

Question posée :

le 16 Oct 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by