Question

using Matlab program: Create a loan payment program that can be used for any loan amount...

using Matlab program:

  1. Create a loan payment program that can be used for any loan amount such as a home or car loan. The program should ask the user for the input values below, compute the monthly payment, then compute the monthly balance. Display the balance in a table

Month             Balance

1                      $ ##.##

2                      $ ##.##

3                      $ ##.##       . . . etc

Use the formula PMT=P*(r(1+r)^n)/((1+r)^n-1)

PMT = the monthly payment.

P = the principal

r = the interest rate per month, which equals the annual interest rate divided by 12

n = the total number of months

You can know if you have it right when the last month’s balance is $0.

0 1
Add a comment Improve this question Transcribed image text
Answer #1

clc; clear; close all; format bank; format compact

principal = input('Enter principal: ');
interest_rate = input('Enter annual interest rate: ');
months = input('Enter total number of months: ');
monthly_interest_rate = interest_rate/1200;

PMT = principal*(monthly_interest_rate*(1+monthly_interest_rate)^months)/((1+monthly_interest_rate)^months-1);

initialBalance = PMT*months;

printf('Month Balance\n');
i=1;

while(i<=months)
initialBalance = initialBalance - PMT;
printf('%d %.2f\n', i, abs(initialBalance));
i = i+1;
end

Add a comment
Know the answer?
Add Answer to:
using Matlab program: Create a loan payment program that can be used for any loan amount...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT