I am learning while loop in MATLAB.
I got an assignment where I have to figure out how many times loop was executed.
Is there any way to do this?
my code is following:
Balance=0;while Balance < 1000000 Balance= 10000+Balance*(1+0.06) end
This assignment require user to figure out how long will it take to reach 1million dolloar when its initial balance is 10000 and the annual compound interest was given as 6%.
I am not even sure if I created the right loop but trying to figure out how many times loop would execute if that loop is executed.
Best Answer