solving an equation recursively
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
ektor
am 17 Jan. 2018
Kommentiert: Star Strider
am 17 Jan. 2018
Dear all,
I want to solve the following equation
m(t)=a(t)+k*m(t-1); t=2,...T
for the entire path m(t), with the initial condition
m(1)=a(1)+k*ee;
where ee=4;
In other words, If we solve the above equation, each m(t) will depend on past and current values of a's.
The vector a in the above equations is known, say a=randn(T,1) and k=0.4.
Any way of doing this?
Thank in advance
0 Kommentare
Akzeptierte Antwort
Star Strider
am 17 Jan. 2018
This seems to be homework, so I’ll not post the solution I coded.
6 Kommentare
Star Strider
am 17 Jan. 2018
How does ‘a’ change in each iteration? You never mentioned that! I was using the information you provided.
You would create and update ‘a’ as ‘a(t)’ the same way you create and update ‘m(t)’, using whatever rule you want to create and define it it. Preallocate ‘a’ as well as ‘m’.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements 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!