diff scripts/linear-algebra/trace.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 2da391ef7f55
line wrap: on
line diff
--- a/scripts/linear-algebra/trace.m
+++ b/scripts/linear-algebra/trace.m
@@ -38,3 +38,14 @@
   endif
 
 endfunction
+
+%!assert(trace ([1, 2; 3, 4]) == 5);
+
+%!assert(trace ([1, 2; 3, 4; 5, 6]) == 5);
+
+%!assert(trace ([1, 3, 5; 2, 4, 6]) == 5);
+
+%!error trace ();
+
+%!error trace (1, 2);
+