Question: Code in MATLAB MatlabFunction Write a function with the header: function [PV] = myPresentValue(FV, n, int) which takes a future value of money, an annual

Code in MATLAB

MatlabFunction

Write a function with the header:

function [PV] = myPresentValue(FV, n, int)

which takes a future value of money, an annual interest rate int, and a number of years, n

to determine all present values of FV from n to 0. (In other words, The last line will be the

amount of money FV is worth at year = 0). If n is less than 1, the code should write some

message to the user and return a single present value of 0. The formula for the present value

(PV) of a future sum of money (FV) with compounding interest (int) for n years is:

Test Cases:

>> format bank;

>> PV = myPresentValue(10600, 1, .06)

PV =

10600.00

10000.00

>> PV = myPresentValue(10600, 0,.06)

Number of periods must be greater than 0

PV =

0

>> PV = myPresentValue(18105.02,8, .11)

PV =

18105.02

16310.83

14694.44

13238.23

11926.34

10744.45

9679.68

8720.44

7856.25

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!