%% 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.
% Copyright 2012 The MathWorks, Inc.