Be the first to rate this file! 105 downloads (last 30 days) File Size: 3.14 KB File ID: #22575

Mortgage Amortization

by Rick Rosson

 

03 Jan 2009 (Updated 01 Jul 2009)

Code covered by BSD License  

Calculates the monthly payment and amortization schedule for a fixed-rate mortgage.

Download Now | Watch this File

File Information
Description

This MATLAB(R) function computes the monthly payment and optionally generates an HTML representation of the mortgage amortization schedule.

The function takes four input arguments:
1. The amount borrowed (dollars)
2. The annual percentage rate (percent per year)
3. The time to maturity (years)
4. A boolean flag indicating whether to generate the HTML Report

The first input argument is required, while the other three are optional (see "Syntax" below).

The function returns one output argument: the monthly payment (in dollars per month) required to pay back the loan.

Syntax:
payment = mortgage(borrowed,apr,ttm,doReport);
payment = mortgage(borrowed,apr,ttm);
payment = mortgage(borrowed,apr);
payment = mortgage(borrowed);

The ZIP file contains two M-functions:
1. mortgage.m is the function that computes the monthly payment and amortization schedule.
2. comma.m is an external utility function that converts a numeric input argument to a comma-formatted string. For more information, please type
>> help comma
at the MATLAB Command Prompt.

MATLAB release MATLAB 7.7 (R2008b)
Zip File Content  
Other Files comma.m,
license.txt,
mortgage.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
01 Jul 2009

Description Only: Updating description field to include Registered Trademark symbol on the word "MATLAB".

Tag Activity for this File
Tag Applied By Date/Time
finance Rick Rosson 05 Jan 2009 16:17:26
mortgage Rick Rosson 05 Jan 2009 16:17:26
html Rick Rosson 05 Jan 2009 16:17:26
amortization Rick Rosson 05 Jan 2009 16:17:26
apr Rick Rosson 05 Jan 2009 16:17:26
present value Rick Rosson 14 Jan 2009 12:02:31
formatting Rick Rosson 30 Jan 2009 21:50:46
comma Rick Rosson 30 Jan 2009 21:50:46
interest rate Rick Rosson 30 Jan 2009 21:50:46
personal finance Rick Rosson 30 Jan 2009 21:51:21
annuity Rick Rosson 30 Jan 2009 21:51:46
www Rick Rosson 30 Jan 2009 21:52:29
economics Rick Rosson 30 Jan 2009 21:53:50
equity Rick Rosson 30 Jan 2009 21:54:12
home buying Rick Rosson 30 Jan 2009 21:54:52
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com