For loop for this ?
이전 댓글 표시
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?
Hannes Arnar
2020년 4월 2일
답변 (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
카테고리
도움말 센터 및 File Exchange에서 Financial Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!