Mercurial > octave-antonio
comparison scripts/statistics/distributions/gamrnd.m @ 11472:1740012184f9
Use uppercase for variable names in error() strings to match Info documentation. Only m-files done.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 21:33:04 -0800 |
parents | be55736a0783 |
children | fd0a3ac60b0e |
comparison
equal
deleted
inserted
replaced
11471:994e2a93a8e2 | 11472:1740012184f9 |
---|---|
36 | 36 |
37 if (nargin > 1) | 37 if (nargin > 1) |
38 if (!isscalar(a) || !isscalar(b)) | 38 if (!isscalar(a) || !isscalar(b)) |
39 [retval, a, b] = common_size (a, b); | 39 [retval, a, b] = common_size (a, b); |
40 if (retval > 0) | 40 if (retval > 0) |
41 error ("gamrnd: a and b must be of common size or scalar"); | 41 error ("gamrnd: A and B must be of common size or scalar"); |
42 endif | 42 endif |
43 endif | 43 endif |
44 endif | 44 endif |
45 | 45 |
46 if (nargin == 4) | 46 if (nargin == 4) |
47 if (! (isscalar (r) && (r > 0) && (r == round (r)))) | 47 if (! (isscalar (r) && (r > 0) && (r == round (r)))) |
48 error ("gamrnd: r must be a positive integer"); | 48 error ("gamrnd: R must be a positive integer"); |
49 endif | 49 endif |
50 if (! (isscalar (c) && (c > 0) && (c == round (c)))) | 50 if (! (isscalar (c) && (c > 0) && (c == round (c)))) |
51 error ("gamrnd: c must be a positive integer"); | 51 error ("gamrnd: C must be a positive integer"); |
52 endif | 52 endif |
53 sz = [r, c]; | 53 sz = [r, c]; |
54 | 54 |
55 if (any (size (a) != 1) | 55 if (any (size (a) != 1) |
56 && (length (size (a)) != length (sz) || any (size (a) != sz))) | 56 && (length (size (a)) != length (sz) || any (size (a) != sz))) |
57 error ("gamrnd: a and b must be scalar or of size [r, c]"); | 57 error ("gamrnd: A and B must be scalar or of size [R, C]"); |
58 endif | 58 endif |
59 elseif (nargin == 3) | 59 elseif (nargin == 3) |
60 if (isscalar (r) && (r > 0)) | 60 if (isscalar (r) && (r > 0)) |
61 sz = [r, r]; | 61 sz = [r, r]; |
62 elseif (isvector(r) && all (r > 0)) | 62 elseif (isvector(r) && all (r > 0)) |
63 sz = r(:)'; | 63 sz = r(:)'; |
64 else | 64 else |
65 error ("gamrnd: r must be a positive integer or vector"); | 65 error ("gamrnd: R must be a positive integer or vector"); |
66 endif | 66 endif |
67 | 67 |
68 if (any (size (a) != 1) | 68 if (any (size (a) != 1) |
69 && (length (size (a)) != length (sz) || any (size (a) != sz))) | 69 && (length (size (a)) != length (sz) || any (size (a) != sz))) |
70 error ("gamrnd: a and b must be scalar or of size sz"); | 70 error ("gamrnd: A and B must be scalar or of size SZ"); |
71 endif | 71 endif |
72 elseif (nargin == 2) | 72 elseif (nargin == 2) |
73 sz = size(a); | 73 sz = size(a); |
74 else | 74 else |
75 print_usage (); | 75 print_usage (); |