# MATLAB: QR decomposition – Why is the first element of an orthogonal matrix always negative

MATLABqr decomposition

Hi, I noticed that the first element of an orthogonal matrix extracted from the qr() function is always negative, whatever the initial matrix and its size. The other elements do not have fixed signs though.
In the simple code below, j=0 always.
j=0;for i=1:1:100000    [Q,~] = qr(randn(3,3));    if Q(1,1)>=0        j=j+1;    else    end  end  disp(j)
Why is that so ?

Q*R = A
(-Q)*(-R) = A