Mercurial > hg > octave-nkf
changeset 4631:cae0b7c46842
[project @ 2003-11-18 18:30:06 by jwe]
author | jwe |
---|---|
date | Tue, 18 Nov 2003 18:30:06 +0000 |
parents | ca70857bdbd1 |
children | 0e28461651f2 |
files | scripts/ChangeLog scripts/statistics/base/iqr.m |
diffstat | 2 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2003-11-18 Danilo Piazzalunga <danilopiazza@libero.it> + + * statistics/base/iqr.m: Handle matrices. + 2003-11-18 John W. Eaton <jwe@bevo.che.wisc.edu> * general/issymmetric.m: Don't fail if norm (x) == 0.
--- a/scripts/statistics/base/iqr.m +++ b/scripts/statistics/base/iqr.m @@ -34,6 +34,15 @@ usage ("iqr (x)"); endif - y = empirical_inv (3/4, x) - empirical_inv (1/4, x); + if (rows (x) == 1) + x = x.'; + endif + + [r, c] = size (x); + y = zeros (1, c); + + for i = 1:c; + y(i) = empirical_inv (3/4, x(:,i)) - empirical_inv (1/4, x(:,i)); + endfor endfunction