comparison scripts/polynomial/deconv.m @ 7411:83a8781b529d

[project @ 2008-01-22 21:52:25 by jwe]
author jwe
date Tue, 22 Jan 2008 21:52:26 +0000
parents a1dbe9d80eee
children ccf38fc1057f
comparison
equal deleted inserted replaced
7410:8a3b2ccc4e11 7411:83a8781b529d
63 else 63 else
64 r = [(zeros (1, lc - ly)), y] - conv (a, b); 64 r = [(zeros (1, lc - ly)), y] - conv (a, b);
65 endif 65 endif
66 66
67 endfunction 67 endfunction
68
69 %!test
70 %! [b, r] = deconv ([3, 6, 9, 9], [1, 2, 3]);
71 %! assert(all (all (b == [3, 0])) && all (all (r == [0, 0, 0, 9])));
72
73 %!test
74 %! [b, r] = deconv ([3, 6], [1, 2, 3]);
75 %! assert(b == 0 && all (all (r == [0, 3, 6])));
76
77 %!test
78 %! [b, r] = deconv ([3, 6], [1; 2; 3]);
79 %! assert(b == 0 && all (all (r == [0, 3, 6])));
80
81 %!error [b, r] = deconv ([3, 6], [1, 2; 3, 4]);;
82
83 %!error <number of rows must match> [b, r] = deconv ([3; 6], [1, 2, 3]);
84