%% Use Triangular Portion of Matrix
% Specify 'upper' to use only the upper triangular portion of an input matrix in the decomposition.
%
% Create a coefficient matrix. Construct a triangular decomposition for the matrix using only the upper triangular portion. This option can be useful in cases where both an upper triangular and lower triangular matrix are stored in the same matrix.

A = randi([0 5],10)

%

dA = decomposition(A,'triangular','upper')

% Copyright 2012 The MathWorks, Inc.