But this is YOUR homework, not ours. Surely if
you can deal with the other cases, you can use
a qr factorization. Perhaps it is time to revisit
your notes and your textbook.
help qr?
If I knew how to solve it I would not ask. I reviewed my notebook, and I did not managed to find anything important. I know that is similar to LU factorization (ie, solving n systems), and there I stopped ... so I asked if someone knows to help .... and without stupid answers....
> If I knew how to solve it I would not ask. I reviewed my notebook, and I did not managed to find anything important. I know that is similar to LU factorization (ie, solving n systems), and there I stopped ... so I asked if someone knows to help .... and without stupid answers....
==================
Once again, why does MATLAB's qr() function not do what you need?
I cant just type inv qr(A)!!!
How did you do this for LU? You took advantage of the fact that A = L*U,
right? How are A, Q, and R related? Can you do something similar?
--
Steve Lord
sl...@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> I cant just type inv qr(A)!!!
To quote your original post, you said you were "just missing matlab code with QR factorization..."
This makes it sounds like the problem you were having is that you did not know how to obtain the QR factorization using MATLAB.
Since the qr() function does this, and if you understand that, it is not clear what further help you were hoping to get from us...
I think he wants to know how, in specific, is achieved the QR decomposition. Since in MATLAB it's a builtin fcn, the code isn't available.
I suggest to look for 'householder reflection' in wikipedia and 'Numerical Computing' by Cleve Moler (MATLAB chief scientist): http://www.mathworks.com/moler/
Oleg
No, I think he does not understand what a qr does.
or how to use the result. He cannot simply type
inv(LU(A)) either and get the results that he would
need.
It is time to go back to the books. A QR is a matrix
factorization. Regardless, he does not want to EVER
compute inv on the results of any of these operators.
For example, he wants to learn how to compute the
inverse of Q, WITHOUT the application of inv. Then
he must use \ (backslash) to deal with R.
If it is a question of wanting to program the QR
itself, then it really is time to return to the books,
as we will not write that code for him, even though
it is not that difficult to write.
John
I have read something on Cleve's book (see above). I find it quite useful but I can't tell if something more detailed and simpler exists...
Thanks
Oleg
I'm not sure what you are looking for. This seems to
give a reasonable explanation of what is necessary, but
I have the feeling that you want more.
http://en.wikipedia.org/wiki/Householder_transformation
A QR is simply a sequence of householder transformations,
used to generate an upper triangular result.
So I would suggest that you write a function that forms
and applies ONE householder transformation to a matrix.
Then just call it in a loop. As you kill off what is in one
column of A, you build up Q at the same time, starting
from an identity matrix. When A is finally upper triangular,
then Q is done too.
John
Yes, i want more :).
I already read the wiki page but I feel a little confused.
I was looking for something that explains linear systems with a more general approach (like Cleve's book but with stronger mathematical background, but maybe better reference is hard to find if not to attend a course in mathematics).
Any advice on a good textbook that starts from a to z (as we say in Italy) will be appreciated.
Thanks
Oleg
from regular quadratic matrix A to calculate A ^ -1 so as to solve AX = I so that n times apply solution with the help of QR-factorization (ie Ax1 = e1, x1 first column of the matrix X )..... QR faktorization is needed only once
ie I am interested in how to generate ei with loop (e1, e2, e3, e4, e5 ,......)
do you now understand what I need............
for i=1:n
ei=zeros(1,n);
ei(i)=1;
% etc.
end
Or, if you want to keep the ei around (rather than overwriting one variable called ei):
e=eye(n);
for i=1:n
% note: ei=e(i,:)
% etc.
end
thank you......