diff 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
line wrap: on
line diff
--- a/scripts/polynomial/deconv.m
+++ b/scripts/polynomial/deconv.m
@@ -65,3 +65,20 @@
   endif
 
 endfunction
+
+%!test
+%! [b, r] = deconv ([3, 6, 9, 9], [1, 2, 3]);
+%! assert(all (all (b == [3, 0])) && all (all (r == [0, 0, 0, 9])));
+
+%!test
+%! [b, r] = deconv ([3, 6], [1, 2, 3]);
+%! assert(b == 0 && all (all (r == [0, 3, 6])));
+
+%!test
+%! [b, r] = deconv ([3, 6], [1; 2; 3]);
+%! assert(b == 0 && all (all (r == [0, 3, 6])));
+
+%!error [b, r] = deconv ([3, 6], [1, 2; 3, 4]);;
+
+%!error <number of rows must match> [b, r] = deconv ([3; 6], [1, 2, 3]);
+