generate test matrices
g = gallery(name, n1, ..., nn) g = gallery(3) g = gallery(5)
matrix name available in the following list: "cauchy", "circul" and "ris
double, scalars or vectors depend on the name of matrix
generated matrix
g = gallery(name, n1, ..., nn) generates a name matrix. n1, ..., nn arguments
depend on the generated matrix (see *name* matrix sections below for more details).
g = gallery(3) is a badly conditioned 3-by-3 matrix.
g = gallery(5) creates a 5-by-5 matrix with an interesting eigenvalue problem.
g = gallery("cauchy", x [, y]) creates a n-by-n Cauchy matrix. x and y are vectors of length n. If x is scalar, then it
will be interpreted as 1:x (same behavior for y).
The Cauchy matrix is defined by g(i,j) = 1/(x(i) + y(j)).
g = gallery("cauchy", x) computes g(i,j) = 1/(x(i) + x(j)).
g = gallery("circul", x) creates a n-by-n Circulant matrix whose first row is given by x. x is vector of length n. If x is scalar, then it
will be interpreted as 1:x.
A circulant matrix is a square matrix whose each row is obtained from the previous one by circular permutation (right shift):
.
g = gallery("ris", n) creates a n-by-n Ris matrix. This matrix is symectric n-by-n Hankel matrix with
g(i,j) = 0.5/(n - i - j + 1.5). Its eigenvalues have the property of clustering near +/- pi/2.
Cauchy matrix
Circulant matrix
Ris matrix
| Version | Description |
| 2026.0.0 | Function added. |