Vectorization
이전 댓글 표시
A= 1000; %amount borrowed
n= 12 ; % number of payments per year
for r= 0.1 : 0.01 : 0.2
fprintf ('%4.0f%' , 100*r ) ;
for k = 15 : 5 25
temp = (1 + r/n) ^(n*k) ;
P = r*A * temp / (n*(temp-1));
fprintf ( '%10.2f' , P) ;
end
end
How can I vectorized these two nested FORs ?
[Edited, Jan Simon, Code formatted]
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Chemistry에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!