qr#
Calculates the Matrix QR decomposition. Matrix A is decomposed in two matrices (Q, R) where Q is an orthogonal matrix and R is an upper triangular matrix.
Available in: math cells, REPL.
Syntax#
qr(A)
Arguments and behavior#
Arguments must match one of the syntax forms above. Use the example as a starting point; arrays and numeric types are accepted only by compatible overloads. The example returns scalar (unknown).
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])Interactive examples could not load. You can still copy the expressions.
Expected result: Q: [[0.5, -0.5, 0.49999999999999994, 0.5], [0.5, 0.5000000000000001, -0.5000000000000002, 0.5000000000000001], [0.5, 0.5, 0.5000000000000001, -0.5000000000000001], [0.5, -0.4999999999999999, -0.5000000000000001, -0.5]] R: [[1.9999999999999996, 3, 2], [0, 5, -2], [0, 0, 4], [0, 0, 0]].