Need help with a matlab function. I have to implement a QR decomposition using givens rotations. The implementation has to use the matlab function "planerot" and the only implementation on stackoverflow that I found did not use this function.
>>367159
>planerot
http://mathworks.com/help/matlab/ref/planerot.html
That the special case for 2x2 matrices, and it can be used to compute the important values in an arbitrary nxn Givens-matrix (the remaining entries are 0 except for the main diagonal which are 1).
So if you multiply the whole rotation matrix, say
[math]\begin{pmatrix}
c &-s & 0 & 0 \\
s & c & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{pmatrix}
\begin{pmatrix}
a_1 & a_2 & a_3 & a_4 \\
b_1 & b_2 & b_3 & b_4 \\
c_1 & c_2 & c_3 & c_4 \\
d_1 & d_2 & d_3 & d_4
\end{pmatrix}
=
\begin{pmatrix}
* & * & * & * \\
0 & * & * & * \\
c_1 & c_2 & c_3 & c_4 \\
d_1 & d_2 & d_3 & d_4
\end{pmatrix}[/math]
Note how you only need to compute two rows (*), you don't actually need the whole Givens-matrix.
Or perhaps you only use planerot to compute the whole Givens-matrix and can use it in the next steps.
>>367296
Was able to implement it, thanks