Mercurial > hg > octave-nkf
changeset 5583:8eebdcfde94e
[project @ 2005-12-15 01:16:26 by jwe]
author | jwe |
---|---|
date | Thu, 15 Dec 2005 01:16:39 +0000 |
parents | 6bf56668b01a |
children | 3d9ddfdc6d3e |
files | scripts/ChangeLog scripts/Makefile.in scripts/general/__isequal__.m scripts/miscellaneous/dir.m scripts/signal/freqz.m |
diffstat | 5 files changed, 31 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,14 @@ +2005-12-14 David Bateman <dbateman@free.fr> + + * miscellaneous/dir.m: Transpose sub-assignment for cleanness. + + * general/__isequal__.m: Remove reference to getfield. + + * plot/hist.m: Update test code for row/column discrepencies. + * signal/freqz.m: Alter output row/column for matlab compatibility. + Update the test code for this. + * sparse/spstats.m: Fix small bug in the dimension of output. + 2005-12-13 William Poetra Yoga Hadisoeseno <williampoetra@gmail.com> * cell/cell2mat.m: New file, from octave-forge. @@ -1191,11 +1202,11 @@ * statistics/distributions/discrete_rnd.m: New argument formats to allow creating arbitrary matrices, compatiable with the other - *_rnd.m functions. Maintain compatiablity with previous format. + *_rnd.m functions. Maintain compatibility with previous format. * statistics/distributions/empirical_rnd.m: New argument formats to allow creating arbitrary matrices, compatiable with the other - *_rnd.m functions. Maintain compatiablity with previous + *_rnd.m functions. Maintain compatibility with previous format. Allow N-d arrays. * statistics/distributions/hypergeometric_cdf.m,
--- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -32,7 +32,7 @@ SUBDIRS = audio control deprecated elfun finance general image io \ linear-algebra miscellaneous optimization plot polynomial \ quaternion set signal sparse specfun special-matrix startup \ - statistics strings time + statistics strings testfun time DISTSUBDIRS = $(SUBDIRS)
--- a/scripts/general/__isequal__.m +++ b/scripts/general/__isequal__.m @@ -66,8 +66,13 @@ for argn = 1:l_v y = varargin{argn}; for [v, k] = x + if (iscell (k)) + fld = y (k{:}); + else + fld = y.(k); + endif t = t && struct_contains (y, k) \ - && __isequal__ (nans_compare_equal, v, getfield (y, k)); + && __isequal__ (nans_compare_equal, v, fld); endfor if (!t) return;
--- a/scripts/miscellaneous/dir.m +++ b/scripts/miscellaneous/dir.m @@ -120,7 +120,7 @@ off = 1; for i = 1:nf tlen = len(i); - file_list(off:off+tlen-1,1) = finfo{i}; + file_list(off:off+tlen-1,1) = finfo{i}.'; off += tlen; endfor endif
--- a/scripts/signal/freqz.m +++ b/scripts/signal/freqz.m @@ -114,19 +114,19 @@ endif endif - a = a(:).'; - b = b(:).'; + a = a(:); + b = b(:); if (! isscalar (n)) ## Explicit frequency vector given w = f = n; if (nargin == 4) ## Sampling rate Fs was specified w = 2*pi*f/Fs; endif - hb = polyval (fliplr(b), exp(-j*w)); - ha = polyval (fliplr(a), exp(-j*w)); + hb = polyval (fliplr(b), exp(j*w)); + ha = polyval (fliplr(a), exp(j*w)); elseif (strcmp (region, "whole")) - f = Fs * (0:n-1) / n; - ## polyval(fliplr(P),exp(-jw)) is O(p n) and fft(x) is O(n log(n)), + f = Fs * (0:n-1)' / n; + ## polyval(fliplr(P),exp(jw)) is O(p n) and fft(x) is O(n log(n)), ## where p is the order of the the polynomial P. For small p it ## would be faster to use polyval but in practice the overhead for ## polyval is much higher and the little bit of time saved isn't @@ -134,7 +134,7 @@ hb = fft (postpad (b, n)); ha = fft (postpad (a, n)); else - f = Fs/2 * (0:n-1) / n; + f = Fs/2 * (0:n-1)' / n; hb = fft (postpad (b, 2*n))(1:n); ha = fft (postpad (a, 2*n))(1:n); endif @@ -170,9 +170,9 @@ %!test # Sampling frequency properly interpreted %! b = [1 1 1]/3; %! [h,f] = freqz(b,1,16,320); -%! assert(f,[0:15]*10,10*eps); +%! assert(f,[0:15]'*10,10*eps); %! [h2,f2] = freqz(b,1,[0:15]*10,320); %! assert(f2,[0:15]*10,10*eps); -%! assert(h,h2,20*eps); +%! assert(h,h2',20*eps); %! [h3,f3] = freqz(b,1,32,'whole',320); -%! assert(f3,[0:31]*10,10*eps); +%! assert(f3,[0:31]'*10,10*eps);