www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/TestNonsquareMatrixExample.m

    %% Test Nonsquare Matrix  

%% 
% Create a 3-by-5 matrix. 
A = [1 0 0 0 0; 2 1 0 0 0; 3 2 1 0 0]  

%% 
% Test if |A| has nonzero elements above the main diagonal. 
isbanded(A,2,0) 

%%
% The result is logical |1| (|true|) because the elements above the main
% diagonal are all zero.