# Constants and Test Matrices

Pi, Not-a-Number, infinity; Hadamard, companion, Pascal, and other specialized matrices

MATLAB® provides several constants, test matrices, and other named matrices as well as functions to examine array elements. You can use these constants, matrices, and functions to test your code and check if your computations return the intended results.

## Functions

expand all

 `eps` Floating-point relative accuracy `flintmax` Largest consecutive integer in floating-point format `i` Imaginary unit `j` Imaginary unit `Inf` Create array of all `Inf` values `pi` Ratio of circle's circumference to its diameter `NaN` Create array of all `NaN` values
 `compan` Companion matrix `gallery` Test matrices `hadamard` Hadamard matrix `hankel` Hankel matrix `hilb` Hilbert matrix `invhilb` Inverse of Hilbert matrix `magic` Magic square `pascal` Pascal matrix `rosser` Classic symmetric eigenvalue test problem `toeplitz` Toeplitz matrix `vander` Vandermonde matrix `wilkinson` Wilkinson's eigenvalue test matrix
 `allfinite` Determine if all array elements are finite `anynan` Determine if any array element is `NaN` `isfinite` Determine which array elements are finite `isinf` Determine which array elements are infinite `isnan` Determine which array elements are NaN