I would like to know how to write the number of periods formula?

Hi,
How can i type the number of periods formula from the time value of money into a script of MATLAB? The formula is: http://www.e-financialmanagement.net/time-value-of-money/number-of-periods/
Thanks in advance!

 Accepted Answer

As an ‘anonymous function’ this is how I do it:
PN = @(PV,FV,r) log(FV/PV)./log(1+r);
Note that r is a decimal fraction, not percent.

More Answers (0)

Categories

Find more on Financial Toolbox in Help Center and File Exchange

Asked:

on 9 May 2014

Answered:

on 9 May 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!