To compute the QR factorization of matrix A
and solve the linear system Rx=b
in MATLAB, you can use the following code:
main.m173 chars12 lines
The solution x
will be the vector approximating the solution to the linear system R*x = Q'*b
.
gistlibby LogSnag