MATLAB: Is ‘qrupdate’ function compatible with the econothe-size QR decomposition ‘qr(A,0)’

decompositioneconomy-sizeMATLABqrqrupdate

I am trying to use 'qrupdate' function on the economy-size Q and R matrices generated from [Q,R] = qr(A,0), where A is mxn with m>n.
For example, if m=5 and n=3, the following code results in an error.
A=rand(5,3);
[Q,R] = qr(A,0);
u = [1,0,0,0,0]';
v = [1,0,0]';
[Q1,R1]=qrupdate(Q,R,u,v)
Error using qrupdate
Matrix dimensions must agree.

Best Answer

  • As described on the documentation page, 'qrupdate' does only work on inputs Q,R from [Q,R]=qr(A). This means  'qr(A,0)' is not supported as of MATLAB R2020b release.