doc QR decomposition error
4 ビュー (過去 30 日間)
古いコメントを表示
Dear Mathwork support,
the qr function doc has a mistake in it: R is a n by n triangular matrix (and not a m by n) and Q is a m by n orthogonal matrix. Consequently the correct sentence should be :
The factor R is an n-by-n upper-triangular matrix, and the factor Q is an m-by-n orthogonal matrix.
0 件のコメント
回答 (1 件)
Christine Tobler
2023 年 10 月 20 日
Hi,
As you can see here, R is an m by n matrix and Q is an m by m matrix in the default behavior of the qr function:
A = randn(4, 3);
[m, n] = size(A)
[Q, R] = qr(A)
You may have been thinking about the "economy" syntax, where for the case of m >= n, Q is m by n and R is n by n.
[Q, R] = qr(A, "econ")
2 件のコメント
Christine Tobler
2023 年 10 月 20 日
It's certainly very common in some applications to always think of QR as the economy-size one, and in others to always think of it as the "complete" version, so it's easy to make assumptions of it always being one or the other.
Keep in mind that R can also be rectangular in the "economy" format, if the original matrix (A of size m-by-n) has fewer rows than columns (m<n). The only case where R is guaranteed to be square for a rectangular input matrix is when m>=n.
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!