%% Q-Less QR Decomposition
% Find the QR decomposition of the 5-by-5 Pascal matrix. Specify one output argument to return just the upper-triangular factor.

A = pascal(5);
X = qr(A)

%
% Extract the upper-triangular factor R from X.

R = triu(X)

%
% Compare the R in the Q-less QR decomposition to the R factor in a full QR decomposition.

[Q1,R1] = qr(A)

%
% Copyright 2019 The MathWorks, Inc.