Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions