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