Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB Code Please Suppose you can get an annual interest rate r (as a decimal).

ID: 3876660 • Letter: M

Question

MATLAB Code Please

Suppose you can get an annual interest rate r (as a decimal). You want to save S dollars over N years. You will need to make a monthly deposit of M = S r/12/(1 + r/12)^12N - 1 Emily can afford to save $80 per month. What interest rate will she need in order to have $11,000 in 8 years? Start with an interest rate of r = 0.01 (too low). Use a while loop to increase the rate by 0.001 until the desired output is reached. Your code may look cleaner if you define M as an anonymous function before the while loop.

Explanation / Answer

S = 80;
r = 0.01;
N = 8;
M=0;
while M<= 11000
M =S*((r/12)/(((1+r/12)^(12*N))-1));
r=r+0.001;

endwhile

fprintf("%f",r);