I have both MATLAB R2011a and R2010b installed on my machine.
One of the changes from R2010b to R2011a affects the implementation of qr() (see the release notes about this particular change here).
An important part of one my projects uses qr() to estimate an orthogonal basis for a direct and inverse transformation. My code applies this transformation to an input signal, processes the transformed coefficients and returns back the processed signal.
Somehow the Q matrix that is now returned from qr() is different from the older version in a way that prevents the processing of the transformed coefficients from working properly.
I use Q and Q' to compute the direct and inverse transformation. More specifically, I use y = Q * x and x = Q' * y to compute the direct and inverse transformation respectively. A different way to compute the direct transform is using least squares. In other words we have two options:
Option 1: Direct and inverse transform using QR factorization:
[Q R] = qr(Z);
y = Q' * x;
x = Q*y;
Option 2: Direct and inverse transform via least squares fitting
where our variables are:
In R2011a the Option 1 above stopped working (it works in R2010b). I really like the idea of using qr() for the direct and inverse transform (it's much faster than computing least-squares for every new vector).
--- QUESTION: ------
If I wanted to use the new qr() in my project, how could I make my transformation work again with the new Q?
NOTE: I am highly confident this is not a numerical stability problem, and more a problem related to differences between the Q matrices returned by the new and old version (as far as I understand, the QR factorization is not unique). The new qr() is probably correct, but the new factorization does not satisfy the same properties that the old one did (see more details here).
More specifically, I think the problem comes from the non-negativity of the diagonal of the R matrix, a property that was guaranteed in the previous version, but not in the new one, and that somehow affects the matrix Q as well.