mrdivide undocumented feature?

I have A = [0 1 ; 3 2] and B = [1 2]. For A / B, I get [0.4 ; 1.4], which is a least squares solution. Here is my problem: where is this documented? I can't see this case covered in the documentation of the mrdivide function. The documentation does say that a least-squared solution is obtained when A is rectangular, but when A is square, all it says is: " If A is a square n-by-n matrix and B is a matrix with n columns, then x = B/A is a solution to the equation x*A = B, if it exists." Since no solution exists, shouldn't it return an error? Or at least, shouldn't the behaviour be documented?

답변 (1개)

Titus Edelhofer
Titus Edelhofer 2017년 7월 26일

0 개 추천

Hi,
I think you might have mixed up A and B from the doc with A and x from your computation:
A/x
In this case your A corresponds to the B where x corresponds to A from doc. And yes, in this case A from doc (your x) is rectangular and B (your A) has n(=2) columns. Everything fine ...
Titus

댓글 수: 4

PeterB
PeterB 2017년 7월 26일
But the documentation specifically says, " If A is a rectangular m-by-n matrix with m ~= n". i.e. m and n must not be equal. The documentation makes no provision for a least squares answer if A is square, as far as I can see.
You're right about the mixing of x and B in my question, though. So that my question matches the documentation, I've gone back and replaced x with B in my question, but I think my problem still stands.
Hi Peter,
sorry, but it's still the other way round:
A = [1 2];
B = [0 1 ; 3 2];
x = B / A
now we have indeed: A is m by n with m~=n and B has n columns. Note, the doc talks about B / A, you wrote A / B.
Titus
PeterB
PeterB 2017년 7월 26일
Duh! OK, now I've got it. Thanks!
Titus Edelhofer
Titus Edelhofer 2017년 7월 26일
Your welcome, glad I could help. You may mark the question then as answered, if you like ...

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

태그

질문:

2017년 7월 26일

댓글:

2017년 7월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by