For loop for this ?
1 次查看(过去 30 天)
显示 更早的评论
Vcd{1} = 125 *(1+rr{1}); %Investment in company
Vcdd{1} = Vcd{1}.*(1+rr{2});
Vcde{1} = Vcdd{1}.*(1+rr{3});
%% rr are cell are that includes returns for time periods
2 个评论
David Hill
2020-4-1
A better description of what you are trying to do would help. Why do you have so many cell arrays?
回答(1 个)
David Hill
2020-4-2
A simple matrix would work much better.
Vcd=125*(ones(3,10).*[1.2,1.3,1.4]').^(1:10);%this is 10 years, each column with the different rates for the year
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!