Matlab, operator A/B

조회 수: 86 (최근 30일)
bayertom
bayertom 2012년 11월 14일
The manual is written:
A\B returns a least-squares solution to the system of equations A*x= B.
It means: x = inv (A'*A)*A'*B? However, the matrix A'*A is singular...
Let us suppose to have two row vectors:
A=[1 2 3]
B=[6 7 6]
A\B
[0 0 0;
0 0 0;
2.0000 2.3333 2.0000]
If ve use MLS:
C = inv (A'*A) singular matrix
C = pinv(A'*A)
[0.0051 0.0102 0.0153
0.0102 0.0204 0.0306
0.0153 0.0306 0.0459]
And
D= C*A'*B
[0.4286 0.5000 0.4286
0.8571 1.0000 0.8571
1.2857 1.5000 1.2857]
So results A\B and inv (A'*A)*A'*B are different... Could anybody wrote me a sequence of Matlab commands in the backgeound of A/B operation in this case?
  댓글 수: 1
Matt J
Matt J 2012년 11월 14일
I think you really meant so say that pinv(A'*A)*A'*B and A\B are different. When A is singular inv (A'*A)*A'*B is undefined.

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

채택된 답변

Matt J
Matt J 2012년 11월 14일
When A is singular there are infinite least squares solutions to A*X=B and A\B will pick just one of them, while pinv(A)*B picks another.
A/B is equivalent to (B'\A')'

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by