Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(a) Write a function (interestOnly.m) that accepts the starting principal (P), the annual interest rate (r), the number of years your money is in the
(a) Write a function (interestOnly.m) that accepts the starting principal (P), the annual interest rate (r), the number of years your money is in the bank (t), and the number of times the interest is compounded per year (n) then displays a table that has the accumulated amount (A) for each year. You will need to use fprintf to format your table as follows: balance $amount1 $amount2 year 1 2 n $amountn fprintf('year balance ') fprintf(". ---- ') //inside your for loop, you will need to add the other fprintf statement :) Plot the amount vs the time in years. (Note: You can build a vector in your loop then plot that over time or you can use hold on and plot the data with each loop iteration.) Try running your functions with the following values: time principal rate $10,000 9% $10,000 9% $1,000 12% $100,000 4% 30 years 30 years 20 years frequency final amount quarterly $14,4410.24 annually $13,2676.78 annually $9,646.29 semi-annually $148,594.74 10 years
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started