Main Content

Determine if matrix is within specific bandwidth

Use the

`bandwidth`

function to find the upper and lower bandwidths of a given matrix.Use

`isbanded`

to test for several different matrix structures by specifying appropriate upper and lower bandwidths. The table below lists some common tests.Lower Bandwidth

Upper Bandwidth

Function Call

Tests for

`0`

`0`

`isbanded(A,0,0)`

Diagonal matrix

`1`

`1`

`isbanded(A,1,1)`

Tridiagonal matrix

`0`

`size(A,2)`

`isbanded(A,0,size(A,2))`

Upper triangular matrix

`size(A,1)`

`0`

`isbanded(A,size(A,1),0)`

Lower triangular matrix

`1`

`size(A,2)`

`isbanded(A,1,size(A,2))`

Upper Hessenberg matrix

`size(A,1)`

`1`

`isbanded(A,size(A,1),1)`

Lower Hessenberg matrix