1 ## Copyright (C) 1995-1998, 2000, 2002, 2005-2007 Kurt Hornik <Kurt.Hornik@wu-wien.ac.at>
3 ## This program is free software; you can redistribute it and/or modify it under
4 ## the terms of the GNU General Public License as published by the Free Software
5 ## Foundation; either version 3 of the License, or (at your option) any later
8 ## This program is distributed in the hope that it will be useful, but WITHOUT
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 ## You should have received a copy of the GNU General Public License along with
14 ## this program; if not, see <http://www.gnu.org/licenses/>.
17 ## @deftypefn {Function File} {} fvl (@var{r}, @var{n}, @var{l})
18 ## Return the future value at the end of @var{n} periods of an initial
19 ## lump sum investment @var{l}, given a per-period interest rate
22 ## Note that the rate @var{r} is specified as a fraction (i.e., 0.05,
26 function v = fvl (r, n, l)
32 if (! (isscalar (r) && r > -1))
33 error ("fvl: r has to be a scalar > -1");
34 elseif (! (isscalar (n) && n > 0))
35 error ("fvl: n has to be a positive scalar");
36 elseif (! isscalar (l))
37 error ("fvl: l has to be a scalar");