"david" wrote in message <jij0k3$jku$1@newscl01ah.mathworks.com>...
> If we have the following equation Y=G*Q with Y,G,Q are matrix
> How to calculate the G matrix from this equation G=Y*inv(Q) or G=inv(Q)*Y ?
      
In answer to your question, G=Y*inv(Q) would be the right way, not inv(Q)*Y. To remember which is correct think of multiplying both sides of the equation Y=G*Q on the right by inv(Q) giving you Y*inv(Q) = G*Q*inv(Q) = G*eye(n) = G.
As Steve has indicated, it is more efficient to use matlab's right matrix division to find G: G = Y/Q rather than finding inv(Q), which involves extensive computation. (At least this is true if the number of rows in Y and G is less than the number of rows and columns in Q and the number of columns in Y and G.) You can use a similar memory device to that in the first paragraph to tell whether Y/Q or Q\Y is correct.
Roger Stafford
