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

    %% Test Upper Triangular Matrix  

%% 
% Create a 5-by-5 matrix. 
A = triu(magic(5))  

%% 
% Test |A| to see if it is upper triangular. 
istriu(A) 

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