FOR Loop Final Answer Problem
古いコメントを表示
Question gives us the vector increase which has the percentage increase for the fees of upcoming years and asks us to find the tuition fee after 4 years if current fee for a year is 5000
Exact Question:

My code is as below. It runs but final value is not correct.
sum = 5000;
increase = [10 8 10 16 15 4 6 7 8 10 8 12 14 15 8 7 6 5 7 8 9 8];
for x = increase(:,1):increase(:,3)
sum = (sum*(x/100)) + sum;
end
fprintf('%d', sum)
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および 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!
