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

2 views (last 30 days)
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

Star Strider
Star Strider on 9 May 2014
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

Community Treasure Hunt

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

Start Hunting!