%% Find Bandwidth of Sparse Block Matrix
% Create a 100-by-100 sparse block matrix.

B = kron(speye(25),ones(4));

%
% View a 10-by-10 section of elements from the top left of B.

full(B(1:10,1:10))

% B has 4-by-4 blocks of ones centered on the main diagonal.
%
% Find both the lower and upper bandwidths of B by specifying two output arguments.

[lower,upper] = bandwidth(B)

% Copyright 2012 The MathWorks, Inc.