Mercurial > hg > octave-lyh
annotate scripts/specfun/betaln.m @ 11188:4cb1522e4d0f
Use function handle as input to cellfun,
rather than quoted function name or anonymous function wrapper.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 03 Nov 2010 17:20:56 -0700 |
parents | 693e22af08ae |
children | fd0a3ac60b0e |
rev | line source |
---|---|
8920 | 1 ## Copyright (C) 1998, 2006, 2007, 2008, 2009 by Nicol N. Schraudolph |
5820 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
5820 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
5820 | 18 |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Mapping Function} {} betaln (@var{a}, @var{b}) | |
10687
a8ce6bdecce5
Improve documentation strings.
Rik <octave@nomad.inbox5.com>
parents:
9211
diff
changeset
|
21 ## Return the natural logarithm of the Beta function, |
5820 | 22 ## @tex |
23 ## $$ | |
24 ## B (a, b) = \log {\Gamma (a) \Gamma (b) \over \Gamma (a + b)}. | |
25 ## $$ | |
26 ## @end tex | |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
8286
diff
changeset
|
27 ## @ifnottex |
5820 | 28 ## |
29 ## @example | |
30 ## betaln (a, b) = gammaln (a) + gammaln (b) - gammaln (a + b) | |
31 ## @end example | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
32 ## |
8517
81d6ab3ac93c
Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents:
8286
diff
changeset
|
33 ## @end ifnottex |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7017
diff
changeset
|
34 ## @seealso{beta, betainc, gammaln} |
5820 | 35 ## @end deftypefn |
36 | |
37 ## Author: Nicol N. Schraudolph <nic@idsia.ch> | |
38 ## Created: 06 Aug 1998 | |
39 ## Keywords: log beta special function | |
40 | |
41 function retval = betaln (a, b) | |
42 if (nargin != 2) | |
6046 | 43 print_usage (); |
5820 | 44 endif |
45 | |
46 retval = gammaln (a) + gammaln (b) - gammaln (a + b); | |
47 endfunction | |
48 | |
49 %!assert (betaln(3,4),log(beta(3,4)),eps) | |
50 | |
51 %!error (betaln(1.)) | |
52 %!error (betaln(1.,1.,1.)) |