I could not understand the process of dividing two not square matrices....
Show older comments
Hello everyone, hope you are doing well :)
I want to ask a question maybe it's silly but i really need your help :$
when i divide two matrix in matlab like this :
x=[1 2 3;
4 5 6];
y=[1 2 3;
4 5 7];
the result will be
[1 0;-0.7143 1.2]
why ??? what is the process here ?? I tried to divide it by vector but it give me another answer I tried to calculate it in another way by multiply x*inv(y) but i could not because it's not legal to calculate inv for not square matrix.
can anyone help me.
Accepted Answer
More Answers (1)
the cyclist
on 4 Aug 2013
Edited: the cyclist
on 4 Aug 2013
MATLAB is doing the matrix division, as you suspected, but in this case it is equivalent to using the "pseudoinverse":
>> z = x * pinv(y);
(That's not actually the calculation it does numerically, though.)
See
>> doc slash
and
>> doc pinv
for some details.
Perhaps you wanted element-by-element division? Then,
>> z = x./y
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!