Navigation

Operators and Keywords

Function List:

C++ API

: gallery (name)
: gallery (name, args)

Create interesting matrices for testing.

: c = gallery ("cauchy", x)
: c = gallery ("cauchy", x, y)

Create a Cauchy matrix.

: c = gallery ("chebspec", n)
: c = gallery ("chebspec", n, k)

Create a Chebyshev spectral differentiation matrix.

: c = gallery ("chebvand", p)
: c = gallery ("chebvand", m, p)

Create a Vandermonde-like matrix for the Chebyshev polynomials.

: a = gallery ("chow", n)
: a = gallery ("chow", n, alpha)
: a = gallery ("chow", n, alpha, delta)

Create a Chow matrix – a singular Toeplitz lower Hessenberg matrix.

: c = gallery ("circul", v)

Create a circulant matrix.

: a = gallery ("clement", n)
: a = gallery ("clement", n, k)

Create a tridiagonal matrix with zero diagonal entries.

: c = gallery ("compar", a)
: c = gallery ("compar", a, k)

Create a comparison matrix.

: a = gallery ("condex", n)
: a = gallery ("condex", n, k)
: a = gallery ("condex", n, k, theta)

Create a ‘counterexample’ matrix to a condition estimator.

: a = gallery ("cycol", [m n])
: a = gallery ("cycol", n)
: a = gallery (…, k)

Create a matrix whose columns repeat cyclically.

: [c, d, e] = gallery ("dorr", n)
: [c, d, e] = gallery ("dorr", n, theta)
: a = gallery ("dorr", …)

Create a diagonally dominant, ill-conditioned, tridiagonal matrix.

: a = gallery ("dramadah", n)
: a = gallery ("dramadah", n, k)

Create a (0, 1) matrix whose inverse has large integer entries.

: a = gallery ("fiedler", c)

Create a symmetric Fiedler matrix.

: a = gallery ("forsythe", n)
: a = gallery ("forsythe", n, alpha)
: a = gallery ("forsythe", n, alpha, lambda)

Create a Forsythe matrix (a perturbed Jordan block).

: f = gallery ("frank", n)
: f = gallery ("frank", n, k)

Create a Frank matrix (ill-conditioned eigenvalues).

: c = gallery ("gcdmat", n)

Create a greatest common divisor matrix.

c is an n-by-n matrix whose values correspond to the greatest common divisor of its coordinate values, i.e., c(i,j) correspond gcd (i, j).

: a = gallery ("gearmat", n)
: a = gallery ("gearmat", n, i)
: a = gallery ("gearmat", n, i, j)

Create a Gear matrix.

: g = gallery ("grcar", n)
: g = gallery ("grcar", n, k)

Create a Toeplitz matrix with sensitive eigenvalues.

: a = gallery ("hanowa", n)
: a = gallery ("hanowa", n, d)

Create a matrix whose eigenvalues lie on a vertical line in the complex plane.

: v = gallery ("house", x)
: [v, beta] = gallery ("house", x)

Create a householder matrix.

: a = gallery ("integerdata", imax, [M N …], j)
: a = gallery ("integerdata", imax, M, N, …, j)
: a = gallery ("integerdata", [imin, imax], [M N …], j)
: a = gallery ("integerdata", [imin, imax], M, N, …, j)
: a = gallery ("integerdata", …, "class")

Create a matrix with random integers in the range [1, imax]. If imin is given then the integers are in the range [imin, imax].

The second input is a matrix of dimensions describing the size of the output. The dimensions can also be input as comma-separated arguments.

The input j is an integer index in the range [0, 2^32-1]. The values of the output matrix are always exactly the same (reproducibility) for a given size input and j index.

The final optional argument determines the class of the resulting matrix. Possible values for class: "uint8", "uint16", "uint32", "int8", "int16", int32", "single", "double". The default is "double".

: a = gallery ("invhess", x)
: a = gallery ("invhess", x, y)

Create the inverse of an upper Hessenberg matrix.

: a = gallery ("invol", n)

Create an involutory matrix.

: a = gallery ("ipjfact", n)
: a = gallery ("ipjfact", n, k)

Create a Hankel matrix with factorial elements.

: a = gallery ("jordbloc", n)
: a = gallery ("jordbloc", n, lambda)

Create a Jordan block.

: u = gallery ("kahan", n)
: u = gallery ("kahan", n, theta)
: u = gallery ("kahan", n, theta, pert)

Create a Kahan matrix (upper trapezoidal).

: a = gallery ("kms", n)
: a = gallery ("kms", n, rho)

Create a Kac-Murdock-Szego Toeplitz matrix.

: b = gallery ("krylov", a)
: b = gallery ("krylov", a, x)
: b = gallery ("krylov", a, x, j)

Create a Krylov matrix.

: a = gallery ("lauchli", n)
: a = gallery ("lauchli", n, mu)

Create a Lauchli matrix (rectangular).

: a = gallery ("lehmer", n)

Create a Lehmer matrix (symmetric positive definite).

: t = gallery ("lesp", n)

Create a tridiagonal matrix with real, sensitive eigenvalues.

: a = gallery ("lotkin", n)

Create a Lotkin matrix.

: a = gallery ("minij", n)

Create a symmetric positive definite matrix MIN(i,j).

: a = gallery ("moler", n)
: a = gallery ("moler", n, alpha)

Create a Moler matrix (symmetric positive definite).

: [a, t] = gallery ("neumann", n)

Create a singular matrix from the discrete Neumann problem (sparse).

: a = gallery ("normaldata", [M N …], j)
: a = gallery ("normaldata", M, N, …, j)
: a = gallery ("normaldata", …, "class")

Create a matrix with random samples from the standard normal distribution (mean = 0, std = 1).

The first input is a matrix of dimensions describing the size of the output. The dimensions can also be input as comma-separated arguments.

The input j is an integer index in the range [0, 2^32-1]. The values of the output matrix are always exactly the same (reproducibility) for a given size input and j index.

The final optional argument determines the class of the resulting matrix. Possible values for class: "single", "double". The default is "double".

: q = gallery ("orthog", n)
: q = gallery ("orthog", n, k)

Create orthogonal and nearly orthogonal matrices.

: a = gallery ("parter", n)

Create a Parter matrix (a Toeplitz matrix with singular values near pi).

: p = gallery ("pei", n)
: p = gallery ("pei", n, alpha)

Create a Pei matrix.

: a = gallery ("Poisson", n)

Create a block tridiagonal matrix from Poisson’s equation (sparse).

: a = gallery ("prolate", n)
: a = gallery ("prolate", n, w)

Create a prolate matrix (symmetric, ill-conditioned Toeplitz matrix).

: h = gallery ("randhess", x)

Create a random, orthogonal upper Hessenberg matrix.

: a = gallery ("rando", n)
: a = gallery ("rando", n, k)

Create a random matrix with elements -1, 0 or 1.

: a = gallery ("randsvd", n)
: a = gallery ("randsvd", n, kappa)
: a = gallery ("randsvd", n, kappa, mode)
: a = gallery ("randsvd", n, kappa, mode, kl)
: a = gallery ("randsvd", n, kappa, mode, kl, ku)

Create a random matrix with pre-assigned singular values.

: a = gallery ("redheff", n)

Create a zero and ones matrix of Redheffer associated with the Riemann hypothesis.

: a = gallery ("riemann", n)

Create a matrix associated with the Riemann hypothesis.

: a = gallery ("ris", n)

Create a symmetric Hankel matrix.

: a = gallery ("smoke", n)
: a = gallery ("smoke", n, k)

Create a complex matrix, with a ‘smoke ring’ pseudospectrum.

: t = gallery ("toeppd", n)
: t = gallery ("toeppd", n, m)
: t = gallery ("toeppd", n, m, w)
: t = gallery ("toeppd", n, m, w, theta)

Create a symmetric positive definite Toeplitz matrix.

: p = gallery ("toeppen", n)
: p = gallery ("toeppen", n, a)
: p = gallery ("toeppen", n, a, b)
: p = gallery ("toeppen", n, a, b, c)
: p = gallery ("toeppen", n, a, b, c, d)
: p = gallery ("toeppen", n, a, b, c, d, e)

Create a pentadiagonal Toeplitz matrix (sparse).

: a = gallery ("tridiag", x, y, z)
: a = gallery ("tridiag", n)
: a = gallery ("tridiag", n, c, d, e)

Create a tridiagonal matrix (sparse).

: t = gallery ("triw", n)
: t = gallery ("triw", n, alpha)
: t = gallery ("triw", n, alpha, k)

Create an upper triangular matrix discussed by Kahan, Golub, and Wilkinson.

: a = gallery ("uniformdata", [M N …], j)
: a = gallery ("uniformdata", M, N, …, j)
: a = gallery ("uniformdata", …, "class")

Create a matrix with random samples from the standard uniform distribution (range [0,1]).

The first input is a matrix of dimensions describing the size of the output. The dimensions can also be input as comma-separated arguments.

The input j is an integer index in the range [0, 2^32-1]. The values of the output matrix are always exactly the same (reproducibility) for a given size input and j index.

The final optional argument determines the class of the resulting matrix. Possible values for class: "single", "double". The default is "double".

: a = gallery ("wathen", nx, ny)
: a = gallery ("wathen", nx, ny, k)

Create the Wathen matrix.

: [a, b] = gallery ("wilk", n)

Create various specific matrices devised/discussed by Wilkinson.

Package: octave