Generated code that mulitples previous number
Ältere Kommentare anzeigen
Hello I want to compute a value assuming Xo = 1
using the formular X = e * (p) . ^ ( e - 1) * X
for first X = e * (p) . ^ ( e - 1) * Xo
Second X = e * (p) . ^ ( e - 1) * X1
Third X = e * (p).^(e - 1) * X2
fourth X = e * (p). ^ (e - 1) * X3
it can be simplified
X0 = 1
X1 = e * (p) . ^ ( e - 1) * Xo
X2 = e * (p) . ^ ( e - 1) * X1
X3 = e * (p) . ^ ( e - 1) * X2
X4 = e * (p) . ^ ( e - 1) * X3
Can anyone assist me in generating this code
Thanks in advance
Regards
Tino
Akzeptierte Antwort
Weitere Antworten (1)
Steven Lord
am 30 Mai 2019
0 Stimmen
Use the cumprod function. [Don't make individually numbered variables, store them as elements of one vector.]
1 Kommentar
Tino
am 30 Mai 2019
Kategorien
Mehr zu Subspace Methods finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!