Matrix division does not work because of matrix dimensions

2 views (last 30 days)
I have two matrices:
A: 5 by 5
B: 5 by 3
How can I claculate matrix division as B divided by A?
I have used:
B / A
B \ A
B ./ A
But all of them show this message:
"Matrix dimensions must agree."

Accepted Answer

Ridwan Alam
Ridwan Alam on 21 Nov 2019
Edited: Ridwan Alam on 21 Nov 2019
B\A gives a warning, but not an error.
B\A means inv(B)*A. But your B is not square, so inv(B) won't work.
And, you are not looking for A\B?
  4 Comments
Hadi Ghahremannezhad
Hadi Ghahremannezhad on 21 Nov 2019
But there are weird numbers in the result:
41.8515350877193 -1.69864901616146e-17 0.500000000000006
-13.9838450292398 43.6678217821782 0.500000000000000
-13.9838450292398 -1.66902048510060e-17 -43.1678217821782
-13.9838450292398 -43.6678217821782 0.499999999999989
-13.9838450292398 -1.27074865530056e-17 44.1678217821782

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!