QR decomposition and matrix dimensions

101 Views Asked by At

How does the time for qr depend on matrix dimensions $m$ and $n$ of $A$ ($A \in \mathbb R^{m×n}$? I tried to test the computational time in MATLAB using tic and toc. I got the following:

enter image description here

So qr works faster if $m<n$. What's the reason for this?

EDIT: I'm actually testing the backslash operator for rectangular matrices as well, and got the similar result. MATLAB Documentation says that if $A$ is non-square, backslash $QR$ solver. Does the time for backslash depend on matrix dimensions $m$ and $n$ of $A$ as well?