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

Please help me with this MATLAB problem! Thank you. It is December 31, 2040, and

ID: 3887870 • Letter: P

Question

Please help me with this MATLAB problem! Thank you.

It is December 31, 2040, and I just retired with $M in the bank. Tomorrow, my annual interest of 6% will be added to that total (so I will have 1.06M), and this will happen every year on January 1. I plan to spend $50,000 per year (so on Dec 31, 2041, I will have 1.06M 50, 000). Write a file retire.m that uses a while loop to accomplish two things:

1. Takes M as an input and returns the number of years until I no longer have $50,000 to get through the next year.

2. Plots the amount in my account as a function of time until I no longer have $50,000 to get through the next year. The horizonal axis should be year starting with 2040.

Explanation / Answer

i=1

a=x

while(a>0)

a=1.06*a-50000

ar(i)=a

i=i+1

end

disp(i)

ari=[2040:2040+i-1]

plot(ari,ar)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote