Mercurial > hg > octave-lyh
comparison scripts/statistics/distributions/discrete_pdf.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 | 83da69c6e7be |
children | fd0a3ac60b0e |
comparison
equal
deleted
inserted
replaced
11471:994e2a93a8e2 | 11472:1740012184f9 |
---|---|
34 endif | 34 endif |
35 | 35 |
36 sz = size (x); | 36 sz = size (x); |
37 | 37 |
38 if (! isvector (v)) | 38 if (! isvector (v)) |
39 error ("discrete_pdf: v must be a vector"); | 39 error ("discrete_pdf: V must be a vector"); |
40 elseif (! isvector (p) || (length (p) != length (v))) | 40 elseif (! isvector (p) || (length (p) != length (v))) |
41 error ("discrete_pdf: p must be a vector with length (v) elements"); | 41 error ("discrete_pdf: P must be a vector with length (V) elements"); |
42 elseif (! (all (p >= 0) && any (p))) | 42 elseif (! (all (p >= 0) && any (p))) |
43 error ("discrete_pdf: p must be a nonzero, nonnegative vector"); | 43 error ("discrete_pdf: P must be a nonzero, nonnegative vector"); |
44 endif | 44 endif |
45 | 45 |
46 n = numel (x); | 46 n = numel (x); |
47 m = length (v); | 47 m = length (v); |
48 x = reshape (x, n, 1); | 48 x = reshape (x, n, 1); |