Mercurial > hg > octave-lyh
diff scripts/special-matrix/invhilb.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 | 81d6ab3ac93c |
line wrap: on
line diff
--- a/scripts/special-matrix/invhilb.m +++ b/scripts/special-matrix/invhilb.m @@ -107,3 +107,20 @@ endif endfunction + +%!test +%! result4 = [16, -120, 240, -140; +%! -120, 1200, -2700, 1680; +%! 240, -2700, 6480, -4200; +%! -140, 1680, -4200, 2800]; +%! +%! assert((invhilb (1) == 1 && invhilb (2) == [4, -6; -6, 12] +%! && invhilb (4) == result4 +%! && abs (invhilb (7) * hilb (7) - eye (7)) < sqrt (eps))); + +%!error invhilb ([1, 2]); + +%!error invhilb (); + +%!error invhilb (1, 2); +