FOR Loop Final Answer Problem
Mostra commenti meno recenti
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)
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
