Mercurial > hg > octave-nkf
changeset 5584:3d9ddfdc6d3e
[project @ 2005-12-15 01:29:34 by jwe]
author | jwe |
---|---|
date | Thu, 15 Dec 2005 01:29:34 +0000 |
parents | 8eebdcfde94e |
children | 6dbb3f6d0054 |
files | scripts/plot/hist.m scripts/sparse/spstats.m |
diffstat | 2 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/hist.m +++ b/scripts/plot/hist.m @@ -139,8 +139,8 @@ %! assert(nn, [2,1,1]); %!test %! [nn,xx]=hist([1:4]',3); -%! assert(xx, [1.5,2.5,3.5]'); -%! assert(nn, [2,1,1]'); +%! assert(xx, [1.5,2.5,3.5]); +%! assert(nn, [2,1,1]); %!test %! [nn,xx]=hist([[1:4]',[1:4]'],3); %! assert(xx, [[1.5,2.5,3.5]',[1.5,2.5,3.5]']);
--- a/scripts/sparse/spstats.m +++ b/scripts/sparse/spstats.m @@ -10,7 +10,7 @@ ## is the mean of the non-zeros in each column, and @var{var} is the ## variance of the non-zeros in each column. ## -## Called with two output arguments, if @var{s} is the data and @var{j} +## Called with two input arguments, if @var{s} is the data and @var{j} ## is the bin number for the data, compute the stats for each bin. In ## this case, bins can contain data values of zero, whereas with ## @code{spstats (@var{s})} the zeros may disappear. @@ -21,14 +21,14 @@ usage("[count, mean, var] = spstats(S) OR spstats(x,j)"); endif - [n, m] = size (S); if nargin == 1 - [i,j,v] = spfind (S); + [i,j,v] = find (S); else v = S; i = 1:length (v); S = sparse (i, j, v); endif + [n, m] = size (S); count = spsum (sparse (i, j, 1, n, m)); if (nargout > 1)