Question: This is a MATLAB question It is desired to create a mortgage estimator by writing a program containing a function. The user inputs the amount

This is a MATLAB question

It is desired to create a mortgage estimator by writing a program containing a function. The user inputs the amount of loan (L), the loan term in number of months (N), and the annual interest rate (I) in the script. The script then makes use of a function that accepts these values as inputs through its argument and calculates and returns the monthly payment and the total payments over the life of the loan. The monthly payment and the total payment could be calculated using the following expressions:

monthly_payment=L/[(1-(1+I/12)^-N)/(I/12)]

total_paymemt=N*monthlt_payment

Note that the interest rate must be expressed in decimal; for example, if the interest rate is 8% it must be entered as 0.08 . Test your program for several scenarios and submit the results with the program listing.

The values of L, N, I, monthly_payment, and total_payment should be written to a file as shown below:

Loan Amount Interest Months Monthly Payment TotalPayment

10000 0.06 36 .... ....

120000 0.05 108 .... ....

85000 0.07 48 .... ....

257000 0.08 240 .... ....

320000 0.05 120 .... .....

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!