How to write a loop to genrate vector that stores NPVs using differnet discount factors (1% to 5% with 1% increment)?
1 次查看(过去 30 天)
显示 更早的评论
Period Cash_Flow
1 155.37
2 5.2
3 78.21
4 4.05
5 21.99
6 17.29
7 64.69
8 222.42
9 60.89
10 151.39
How to write a loop to genrate vector that stores NPVs using differnet discount factors (1% to 5% with 1% increment)?
0 个评论
采纳的回答
VBBV
2022-2-21
Initial = 200; % initial investment
D = [
1 155.37
2 5.2
3 78.21
4 4.05
5 21.99
6 17.29
7 64.69
8 222.42
9 60.89
10 151.39];
r = 0.01:0.01:0.05; % discount rate
for k = 1:size(D,1)
PVDCF(k,:) = D(k,2)./(1+r).^D(k,1);
end
PVDCF
PV = sum(PVDCF) % sum present value for each discount rate
NPV = sum(PVDCF) - Initial % NPV for each discount rate
0 个评论
更多回答(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!