Economic formulas are available to compute annual payments for loans. Suppose that you borrow an amount of money P and agree to repay it in n annual payments at an interest rate of i. The formula to compute the annual payment A is A = P * ((i (1+i)^n)/((1+i)^n - 1)). Write a program to compute A. Test it with P = $55000 an an interest rate of 66%. Compute results for n = 1,2,3,4,5.
Matlab Code:
p = 55000;
i = .066;
n = 1:5;
A = p * ((i*(1+i).^n)./((1+i).^n - 1));
Results:
No comments:
Post a Comment