compunding investment every month

1 次查看(过去 30 天)
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?

采纳的回答

Kuifeng
Kuifeng 2016-4-3
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 个评论
jean claude
jean claude 2016-4-3
thank you for high speed answer !
Kuifeng
Kuifeng 2016-4-3
you are welcome, just happened to be reading your questions.

请先登录,再进行评论。

更多回答(1 个)

grim fin
grim fin 2022-2-15
编辑:grim fin 2022-3-9
Thanks a lot

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by