compunding investment every month

2 Ansichten (letzte 30 Tage)
jean claude
jean claude am 3 Apr. 2016
Bearbeitet: grim fin am 9 Mär. 2022
hi, i have vector X=[ 0.35; 0.05; 0.06 ;0.07] i want to have y=[100*1.35 ; 100*1.35*1.05 ; 100*1.35*1.05*1.06 ; 100*1.35*1.05*1.06*1.07]
its like compunding my investment 100 $ every month any help?

Akzeptierte Antwort

Kuifeng
Kuifeng am 3 Apr. 2016
X=[ 0.35; 0.05; 0.06 ;0.07];
x1 = 1+X;
base = 100;
y = base.*x1(1);
for i = 2:length(X)
y(i) = y(i-1)*x1(i);
end
  2 Kommentare
jean claude
jean claude am 3 Apr. 2016
thank you for high speed answer !
Kuifeng
Kuifeng am 3 Apr. 2016
you are welcome, just happened to be reading your questions.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

grim fin
grim fin am 15 Feb. 2022
Bearbeitet: grim fin am 9 Mär. 2022
Thanks a lot

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by