Mercurial > hg > octave-nkf
comparison scripts/finance/npv.m @ 3407:5e0a0b1cba43
[project @ 2000-01-06 03:13:55 by jwe]
author | jwe |
---|---|
date | Thu, 06 Jan 2000 03:14:17 +0000 |
parents | 42cb61dd0248 |
children | ae7adbb591e8 |
comparison
equal
deleted
inserted
replaced
3406:772cc0f88f09 | 3407:5e0a0b1cba43 |
---|---|
12 ## | 12 ## |
13 ## You should have received a copy of the GNU General Public License | 13 ## You should have received a copy of the GNU General Public License |
14 ## along with this file. If not, write to the Free Software Foundation, | 14 ## along with this file. If not, write to the Free Software Foundation, |
15 ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 15 ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
16 | 16 |
17 ## usage: npv (r, p [, i]) | 17 ## -*- texinfo -*- |
18 ## @deftypefn {Function File} {} npv (@var{r}, @var{p} [, @var{i}]) | |
19 ## Returns the net present value of a series of irregular (i.e., not | |
20 ## necessarily identical) payments @var{p} which occur at the ends of @var{n} | |
21 ## consecutive periods. @var{r} specifies the one-period interest rates and | |
22 ## can either be a scalar (constant rates) or a vector of the same | |
23 ## length as @var{p}. | |
18 ## | 24 ## |
19 ## Returns the net present value of a series of irregular (i.e., not | 25 ## With the optional scalar argument @var{i}, one can specify an initial |
20 ## necessarily identical) payments p which occur at the ends of n | |
21 ## consecutive periods. r specifies the one-period interest rates and | |
22 ## can either be a scalar (constant rates) or a vector of the same | |
23 ## length as p. | |
24 ## | |
25 ## With the optional scalar argument i, one can specify an initial | |
26 ## investment. | 26 ## investment. |
27 ## | 27 ## |
28 ## Note that rates are not specified in percent, i.e., one has to write | 28 ## Note that rates are not specified in percent, i.e., one has to write |
29 ## 0.05 rather than 5 %. | 29 ## 0.05 rather than 5 %. |
30 ## | 30 ## @end deftypefn |
31 ## See also: irr; pv. | 31 ## @seealso{irr, pv} |
32 | 32 |
33 ## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> | 33 ## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> |
34 ## Description: Net present value of a series of payments | 34 ## Description: Net present value of a series of payments |
35 | 35 |
36 function v = npv (r, p, i) | 36 function v = npv (r, p, i) |