Documentation

# wilkinson

Wilkinson's eigenvalue test matrix

## Syntax

``W = wilkinson(n)``
``W = wilkinson(n,classname)``

## Description

example

````W = wilkinson(n)` returns one of J. H. Wilkinson's `n`-by-`n` eigenvalue test matrices. `W` is a symmetric, tridiagonal matrix with pairs of nearly equal eigenvalues.```
````W = wilkinson(n,classname)` returns a matrix of class `classname`, which can be `'single'` or `'double'`.```

## Examples

collapse all

Compute a 7-by-7 Wilkinson eigenvalue test matrix. The most frequently used case is `wilkinson(21)`, whose two largest eigenvalues are approximately 10.746. The eigenvalues agree to 14, but not 15, decimal places.

`W = wilkinson(7)`
```W = 7×7 3 1 0 0 0 0 0 1 2 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1 2 1 0 0 0 0 0 1 3 ```

## Input Arguments

collapse all

Matrix order, specified as a scalar, nonnegative integer.

Example: `wilkinson(10)`

Data Types: `single` | `double` | `int8` | `int16` | `int32` | `int64` | `uint8` | `uint16` | `uint32` | `uint64` | `logical` | `char`

Matrix class, specified as either `'double'` or `'single'`.

Example: `wilkinson(10,'single')`

Data Types: `char`