Mercurial > octave-nkf
comparison scripts/statistics/distributions/gamrnd.m @ 10549:95c3e38098bf
Untabify .m scripts
author | Rik <code@nomad.inbox5.com> |
---|---|
date | Fri, 23 Apr 2010 11:28:50 -0700 |
parents | 3306cfcb856e |
children | be55736a0783 |
comparison
equal
deleted
inserted
replaced
10548:479536c5bb10 | 10549:95c3e38098bf |
---|---|
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) |
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]; |
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 |