I think my answer is not correct for this question, anyone can help me to check it? Thanks
Ältere Kommentare anzeigen
Attached file is the question. Here is my code
B = 10000;
m = 0;
P = input('monthly payment?')
while B>0
B=B*(1.005);
B=B-P
m=m+1
end
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 27 Jun. 2015
B = 10000;
m = 0;
P = input('monthly payment?')
while B>0
B=B*(1.005);
B=B-P; %changed
m=m+1; %changed
end
disp(m); %changed
1 Kommentar
Erwin Koman
am 27 Jun. 2015
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!