Mercurial > matrix-functions
comparison toolbox/hilb.m @ 0:8f23314345f4 draft
Create local repository for matrix toolboxes. Step #0 done.
author | Antonio Pino Robles <data.script93@gmail.com> |
---|---|
date | Wed, 06 May 2015 14:56:53 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:8f23314345f4 |
---|---|
1 function H = hilb(n) | |
2 %HILB Hilbert matrix. | |
3 % HILB(N) is the N-by-N matrix with elements 1/(i+j-1). | |
4 % It is a famous example of a badly conditioned matrix. | |
5 % COND(HILB(N)) grows like EXP(3.5*N). | |
6 % See INVHILB (standard MATLAB routine) for the exact inverse, which | |
7 % has integer entries. | |
8 % HILB(N) is symmetric positive definite, totally positive, and a | |
9 % Hankel matrix. | |
10 | |
11 % References: | |
12 % M.-D. Choi, Tricks or treats with the Hilbert matrix, Amer. Math. | |
13 % Monthly, 90 (1983), pp. 301-312. | |
14 % N.J. Higham, Accuracy and Stability of Numerical Algorithms, | |
15 % Society for Industrial and Applied Mathematics, Philadelphia, PA, | |
16 % USA, 1996; sec. 26.1. | |
17 % M. Newman and J. Todd, The evaluation of matrix inversion | |
18 % programs, J. Soc. Indust. Appl. Math., 6 (1958), pp. 466-476. | |
19 % D.E. Knuth, The Art of Computer Programming, | |
20 % Volume 1, Fundamental Algorithms, second edition, Addison-Wesley, | |
21 % Reading, Massachusetts, 1973, p. 37. | |
22 | |
23 if n == 1 | |
24 H = 1; | |
25 else | |
26 H = cauchy( (1:n) - .5); | |
27 end |