Mercurial > octave-nkf
comparison scripts/statistics/distributions/unifrnd.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 |
---|---|
34 | 34 |
35 if (nargin > 1) | 35 if (nargin > 1) |
36 if (!isscalar(a) || !isscalar(b)) | 36 if (!isscalar(a) || !isscalar(b)) |
37 [retval, a, b] = common_size (a, b); | 37 [retval, a, b] = common_size (a, b); |
38 if (retval > 0) | 38 if (retval > 0) |
39 error ("unifrnd: a and b must be of common size or scalar"); | 39 error ("unifrnd: a and b must be of common size or scalar"); |
40 endif | 40 endif |
41 endif | 41 endif |
42 endif | 42 endif |
43 | 43 |
44 if (nargin == 4) | 44 if (nargin == 4) |
49 error ("unifrnd: c must be a positive integer"); | 49 error ("unifrnd: c must be a positive integer"); |
50 endif | 50 endif |
51 sz = [r, c]; | 51 sz = [r, c]; |
52 | 52 |
53 if (any (size (a) != 1) | 53 if (any (size (a) != 1) |
54 && (length (size (a)) != length (sz) || any (size (a) != sz))) | 54 && (length (size (a)) != length (sz) || any (size (a) != sz))) |
55 error ("unifrnd: a and b must be scalar or of size [r, c]"); | 55 error ("unifrnd: a and b must be scalar or of size [r, c]"); |
56 endif | 56 endif |
57 elseif (nargin == 3) | 57 elseif (nargin == 3) |
58 if (isscalar (r) && (r > 0)) | 58 if (isscalar (r) && (r > 0)) |
59 sz = [r, r]; | 59 sz = [r, r]; |
62 else | 62 else |
63 error ("unifrnd: r must be a positive integer or vector"); | 63 error ("unifrnd: r must be a positive integer or vector"); |
64 endif | 64 endif |
65 | 65 |
66 if (any (size (a) != 1) | 66 if (any (size (a) != 1) |
67 && (length (size (a)) != length (sz) || any (size (a) != sz))) | 67 && (length (size (a)) != length (sz) || any (size (a) != sz))) |
68 error ("unifrnd: a and b must be scalar or of size sz"); | 68 error ("unifrnd: a and b must be scalar or of size sz"); |
69 endif | 69 endif |
70 elseif (nargin == 2) | 70 elseif (nargin == 2) |
71 sz = size(a); | 71 sz = size(a); |
72 else | 72 else |