I would like to know how to write the number of periods formula?
2 views (last 30 days)
Show older comments
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!
0 Comments
Accepted Answer
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.
0 Comments
More Answers (0)
See Also
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!