Matlab - Exercise 20

The lump sum S to be paid when interest on a loan is compounded annually is given by
S = P(1 + i)^n,
where P is the principal invested, i is the interest rate, and n is the number of years. Write a program that will plot the amount S as it increases through the years from 1 to n. The main script will call a function to prompt the user for the number of years (and error-check to make sure that the user enters a positive integer). The script will then call a function that will plot S for years 1 through n. It will use 0.05 for the interest rate and $10,000 for P.



For more details, please contact me here.