Mercurial > hg > octave-lyh
diff scripts/statistics/distributions/stdnormal_pdf.m @ 4854:4b0f3b055331
[project @ 2004-04-07 02:37:05 by jwe]
author | jwe |
---|---|
date | Wed, 07 Apr 2004 02:38:06 +0000 |
parents | 38c61cbf086c |
children | 4c8a2e4e0717 |
line wrap: on
line diff
--- a/scripts/statistics/distributions/stdnormal_pdf.m +++ b/scripts/statistics/distributions/stdnormal_pdf.m @@ -32,14 +32,12 @@ usage ("stdnormal_pdf (x)"); endif - [r, c] = size (x); - s = r * c; - x = reshape (x, 1, s); - pdf = zeros (1, s); + sz = size(x); + pdf = zeros (sz); k = find (isnan (x)); if (any (k)) - pdf(k) = NaN * ones (1, length (k)); + pdf(k) = NaN; endif k = find (!isinf (x)); @@ -47,6 +45,4 @@ pdf (k) = (2 * pi)^(- 1/2) * exp (- x(k) .^ 2 / 2); endif - pdf = reshape (pdf, r, c); - -endfunction \ No newline at end of file +endfunction