[TOC]

bandwidth

Matrix bandwidth

Usage

[low,up] = bandwidth(A)

bandwidth(A, type)

Examples

Input
% Creating a random complex matrix with 30% of its entries
% being non-zero.
a=zeros(5);
i=randi(numel(a),1,ceil(numel(a)*.3));
a(i)=7+7i
% Finding lower and upper bandwidths
[l,u]=bandwidth(a)
Output
a =
 0.000 + 0.000i   7.000 + 7.000i   0.000 + 0.000i   0.000 + 0.000i   0.000 + 0.000i
 0.000 + 0.000i   0.000 + 0.000i   0.000 + 0.000i   0.000 + 0.000i   0.000 + 0.000i
 0.000 + 0.000i   0.000 + 0.000i   0.000 + 0.000i   7.000 + 7.000i   7.000 + 7.000i
 0.000 + 0.000i   0.000 + 0.000i   7.000 + 7.000i   0.000 + 0.000i   7.000 + 7.000i
 0.000 + 0.000i   7.000 + 7.000i   7.000 + 7.000i   0.000 + 0.000i   7.000 + 7.000i

l =
 3.000

u =
 2.000
Input
% Creating a random complex matrix with 30% of its entries
% being non-zero.
a=zeros(5);
i=randi(numel(a),1,ceil(numel(a)*.3));
a(i)=7+7i
% Finding lower and upper bandwidths
l=bandwidth(a,'lower')
u=bandwidth(a,'upper')
Output
a =
 0.000 + 0.000i   0.000 + 0.000i   0.000 + 0.000i   0.000 + 0.000i   0.000 + 0.000i
 0.000 + 0.000i   0.000 + 0.000i   0.000 + 0.000i   7.000 + 7.000i   0.000 + 0.000i
 7.000 + 7.000i   0.000 + 0.000i   0.000 + 0.000i   0.000 + 0.000i   7.000 + 7.000i
 0.000 + 0.000i   7.000 + 7.000i   0.000 + 0.000i   7.000 + 7.000i   0.000 + 0.000i
 0.000 + 0.000i   0.000 + 0.000i   7.000 + 7.000i   0.000 + 0.000i   0.000 + 0.000i

l =
 2.000

u =
 2.000