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)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.