Mercurial > hg > octave-max
changeset 10740:6cc789b3f0e3
scripts/polynomial/deconv.m: ensure that the orientation of the third input to 'filter' matches the orientation of 'y'.
author | Soren Hauberg <hauberg@gmail.com> |
---|---|
date | Sun, 04 Jul 2010 12:38:40 +0200 |
parents | d27bd2f74137 |
children | 38bdcbb58df7 |
files | scripts/ChangeLog scripts/polynomial/deconv.m |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-07-04 Soren Hauberg <hauberg@gmail.com> + + * polynomial/deconv.m: ensure that the orientation of the third + input to 'filter' matches the orientation of 'y'. + 2010-07-02 Rik <octave@nomad.inbox5.com> * audio/wavread.m: Correctly handle non-word aligned data chunks.
--- a/scripts/polynomial/deconv.m +++ b/scripts/polynomial/deconv.m @@ -55,7 +55,9 @@ endif if (ly > la) - b = filter (y, a, [1, (zeros (1, ly - la))]); + x = zeros (size (y) - size (a) + 1); + x (1) = 1; + b = filter (y, a, x); elseif (ly == la) b = filter (y, a, 1); else @@ -100,6 +102,9 @@ %! [b, r] = deconv ([3; 6], [1, 2, 3]); %! assert (b == 0 && all (all (r == [3; 6]))) +%!test +%! assert (deconv ((1:3)',[1, 1]), [1; 1]) + %!error [b, r] = deconv ([3, 6], [1, 2; 3, 4]); %!error [b, r] = deconv ([3, 6; 1, 2], [1, 2, 3]);