%% Test Sparse Block Matrix
% Create a 100-by-100 sparse block matrix.

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

%
% Test if B has a lower and upper bandwidth of 1.

isbanded(B,1,1)

% The result is logical 0 (false) because the nonzero blocks centered on the main diagonal are larger than 2-by-2.
%
% Test if B has a lower and upper bandwidth of 3.

isbanded(B,3,3)

% The result is logical 1 (true). The matrix, B, has an upper and lower bandwidth of 3 since the nonzero diagonal blocks are 4-by-4.
% Copyright 2012 The MathWorks, Inc.