Results 1 to 1 of 1

Math Help - Matlab financial help

  1. #1
    Newbie
    Joined
    Jul 2008
    Posts
    13

    Matlab financial help

    I'm quite new to matlab and im having problems with one of the questions for uni.

    Calculate the total amount of an inputted investment after n years of growth where the annual interest rate may change at the start of the year but not during the year the annual interest rates should be inputted into a 1D array. The programme should also draw a graph which shows the amount of the investment at the end of each of the n years.

    what i've got so far is

    p=input('Give the initial amount invested: ');
    n=input('Give the number of years: ');
    disp('Give the interest rates on successive lines: ')

    for i=1:n
    x(i)=input('');

    end

    y=p*(1+(mean(x))/100)^n

    fprintf('The total amount is %1.2f\n',y)




    I also did it as a loop, but didn't know which would be betta for a graph



    clear
    clc
    p=input('Give the initial amount invested: ');
    n=input('Give the number of years: ');
    disp('Give the interest rates on successive lines: ')

    for i=1:n
    x(i)=input('');

    end


    for j=1:n
    p1=(p*((x(j)/100)))+p;


    p=p1;

    end

    fprintf('The total amount is %1.2f\n',p1)


    I have no idea how to plot the graph is my formula wrong or am I just missing something. I've been at this for a few days now any help would be appreciated

    Emma
    Last edited by princessamme@hotmail.com; April 12th 2009 at 06:43 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Financial Investment
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: October 5th 2011, 03:28 AM
  2. Financial Problem
    Posted in the Business Math Forum
    Replies: 4
    Last Post: January 26th 2010, 10:30 AM
  3. Financial Mathematics
    Posted in the Business Math Forum
    Replies: 0
    Last Post: December 9th 2008, 01:27 PM
  4. Financial Mathematics
    Posted in the Business Math Forum
    Replies: 5
    Last Post: September 7th 2007, 02:59 PM
  5. Financial Management
    Posted in the Business Math Forum
    Replies: 1
    Last Post: July 22nd 2005, 09:38 PM

Search Tags


/mathhelpforum @mathhelpforum