Question: Please make sure code follows all MATLAB rules An amount of money P is invested in an account where interest is compounded at the end

Please make sure code follows all MATLAB rules

 Please make sure code follows all MATLAB rules An amount of

money P is invested in an account where interest is compounded at

An amount of money P is invested in an account where interest is compounded at the end of the period. The future worth F yielded at an interest rate i after n periods may be determined from the following formula: F = P(1+i) An Write a function that will calculate the future worth of an investment for each year from 1 through n. The input to the function should include the initial investment P, the interest rate i (as a decimal), and the number of years n for which the future worth is to be calculated. The output should consist of a table (created using the fprintf command) with headings and columns for number of years and the F value corresponding to each year. Your function will be tested using unknown (to you) values for P, n, and i so be sure that your function will run properly regardless of the inputted values. i function f=futureWorth(P, i,n) 2 3 4 5 6 7 fprintf(" year future worth '); fprintf('%50 %14.2f ',t); %t is a matrix consisting of values for n in column 1 and the corresponding F values in column 2 8 9 end 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!