logo for matrixlab-examples.com
[?] Subscribe To This Site

XML RSS
Add to Google
Add to My Yahoo!
Add to My MSN
Subscribe with Bloglines


Home
Welcome Matrixmania Blog
-> Sitemap / Search <-
-> Books <-
Forums and Help
Contact
Basics Quick Matlab Guide
Matlab Tutorial
Matlab Examples
Matlab Flow Control
Boolean Logic
Plots and GUI Matlab 2D Plots
Matlab 3D Plots
Matlab GUI
Applications Calculus
Linear Algebra
Matlab Cookbook I
Matlab Cookbook II
Electrical Calculations
Probability and Stats
Finance Apps
Other Relevant Links
Notes on Computing
Online Calculators
Fun!
Your own Website?
Terms/Policies
Scilab
leftimage for matrixlab-examples.com

Calculate Annuity - or Future Value of Regular Deposits

In this article we create a script to calculate annuity or to find out the future value of a regular deposit.
      


You must provide the amount of each deposit, the number of deposits per year, the number of years and the nominal interest rate.

Assuming that interest is compounded with each deposit, the calculation is based on the following formula:
 

 formula to calculate annuity

where:
T = total value after Y years (future value)
R = amount of regular deposits
N = number of deposits per year
Y = number of years
i = nominal interest rate
 

This is our Matlab function or script to calculate the above formula: 

function t = annuity(r, it, n, y)
it = it/(n*100);
t = r * ((1 + it)^(n * y) - 1)/it;

 

We can create another script to test and run the above m-file: 

clc; clear; format bank

r = input('Enter amount of regular deposits: ');
it = input(
'Enter nominal interest rate: ');
n = input(
'Enter number of deposits per year: ');
y = input(
'Enter number of years: '); 

future_value = annuity(r, it, n, y)

 

Example 1: 


$50 is transferred each month from Monique’s checking account to a Math Learning Club savings account with 5% interest. How much will Monique receive at the end of the year?
 

We run our test code and get: 

Enter amount of regular deposits: 50
Enter nominal interest rate: 5
Enter number of deposits per year: 12
Enter number of years: 1 

Our result is: 

future_value = 613.94
 

Example 2:


Little George makes annuity payments of $175. The interest is 5.5%. What amount will George have accumulated in 15 years?
 

Again, we run our ‘Calculate Annuity’ code, and get: 

Enter amount of regular deposits: 175
Enter nominal interest rate: 5.5
Enter number of deposits per year: 1
Enter number of years: 15 

The result is: 

future_value = 3921.5

From 'Calculate Annuity' to home

From 'Calculate Annuity' to 'Finance Formulas'


Online Calculator

Calculate future value

Bank widthdrawals

Initial investments

Nominal interest rate

Compound Interest

Top




footer for calculate annuity page