What is the result of A/B ???? (if A and B are same 3x1 row vectors) Example:
A=[-1;1;7]
B=[5;7;-2]
A/B
in Matlab gives: ans =
0 -0.1429 0
0 0.1429 0
0 1.0000 0

댓글 수: 5

Adam
Adam 2017년 10월 9일
You seem to have answered your own question by giving us the result.
doc mrdivide
will answer the question more generally though.
If you want element-wise division then use
A./B
mimalo salina
mimalo salina 2017년 10월 9일
I know that mrdivide means the matrix right division, but here in my case i have two vectors and A./B is the division element by element, my question is what does mean A/B ?
Adam
Adam 2017년 10월 9일
It means what it says on the help page! If you know it means matrix right division then what is your question? A/B means matrix right division, that is the answer!
mimalo salina
mimalo salina 2017년 10월 9일
편집: mimalo salina 2017년 10월 9일
yes, but A ,B are same 3x1 row vectors, it seems false, because , we can't divide two vectors? i want to undersand the meaning of this result !
Guillaume
Guillaume 2017년 10월 9일
편집: Guillaume 2017년 10월 9일
"we can't divide two vectors". Well, obviously you can apply the / operators to two vectors since matlab give you a result.
As Adam said in his comment and as Jan showed in its answer, what it does is fully documented. It solves a system of linear equation. If the right-hand side is not a square matrix as is the case here, it is solved using least-square method. As documented:
If A is a rectangular m-by-n matrix with m ~= n, and B is a matrix with n columns, then x = B/A returns a least-squares solution of the system of equations x*A = B
I'm not sure what other answer you are looking for.

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

 채택된 답변

Jan
Jan 2017년 10월 9일

2 개 추천

C = A / B determines the matrix C such that:
C * B = A
Try it:
A = [-1;1;7];
B = [5;7;-2];
C = A / B;
C * B
>> [-1; 1; 7]

추가 답변 (2개)

John D'Errico
John D'Errico 2017년 10월 9일

1 개 추천

A=[-1;1;7];
B=[5;7;-2];
First of all, A and B are NOT row vectors. They are column vectors. Thus, A is a vector in column orientation.
A
A =
-1
1
7
Next, what is C=A/B?
C = A/B
C =
0 -0.142857142857143 0
0 0.142857142857143 0
0 1 0
It is a matrix, such that if possible, we will have A=C*B.
C*B
ans =
-1
1
7
In some cases of vectors or matrices of varying sizes, that will not be possible.
mimalo salina
mimalo salina 2017년 10월 9일

0 개 추천

Action closed.
Thanks a lot for all your answers!
Kind regards.

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2017년 10월 9일

답변:

2017년 10월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by