Part A
When calculating the payment of a mortgage, the relationship between
the loan amount, Loan, the monthly payment, MPay, the duration of the loan
in months Months, and the annual interest rate, Rate, is given by the equation
(annuity equation):
$MPay = \frac{Loan \cdot Rate}{12 \left(1 - \frac{1}{\left(1 + \frac{Rate}{12}\right)^{Months}}\right)}$
Determine the rate of a 20 years, $300,000 loan if the monthly payment is
$1684.57.
(a) Build a user-defined function SteffensenRoot to solve the problem using
MATLAB.
(b) Use MATLAB's built-in function fzero.