필터 지우기
필터 지우기

Row vector divide by row vector

조회 수: 15 (최근 30일)
Jimmy Zhan
Jimmy Zhan 2020년 7월 29일
편집: Bruno Luong 2020년 7월 31일
Can anyone explain what is the mathematical operation for C = A/B where A and B are both row vectors?
>> A = [1 2 3 4]
>> B = [2 2 2 2]
>> C = A/B
C =
1.2500
As you can see, C*B is not equal to A. This suggest that / is not a matrix right division. It almost looks like / is the average of elementwise division between two row vectors.

채택된 답변

Bruno Luong
Bruno Luong 2020년 7월 29일
편집: Bruno Luong 2020년 7월 29일
It returns the scalar C (maxtrix 1x1) such that
C*B ~ A
in the sense that
norm(C*B - A)^2 % or equivalently
sum((C*B - A).^2)
is minimal.
Illustration:
>> sum((C*B-A).^2)
ans =
5
>> sum(((C+0.1)*B-A).^2) % move on the right
ans =
5.1600
>> sum(((C-0.1)*B-A).^2) % move on the left
ans =
5.1600
>> ezplot(@(x) sum((x*B-A).^2), [-1 3]) % plot this function, that is a parabola minimum at x=1.25
>> xline(A/B)
  댓글 수: 1
Bruno Luong
Bruno Luong 2020년 7월 31일
편집: Bruno Luong 2020년 7월 31일
If you want a direct formula, A/B is equal to (applicable for real and complex row vectors)
dot(B,A) / dot(B,B)
or
(A*B') / (B*B')

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by