Matrix dimensions must agree error for backslash.

4 views (last 30 days)
Hi all, I have a 1080x1080 matrix A and 1x1080 matrix B. The values in matrix B are all zeroes except for two values. When I use A\B, I get the 'Matrix dimensions must agree.' error. Where am I going wrong?

Accepted Answer

KSSV
KSSV on 4 Dec 2016
Edited: KSSV on 4 Dec 2016
Try A\B'
  2 Comments
Vinay Kumar Kuthunur Gopala Krishna Rao
Thanks! I go an output. But why didn't I get this when I just used B instead of B'?
KSSV
KSSV on 4 Dec 2016
B should be a column matrix with rows equal to rows in A.B' is transpose of B. 1*1080 is transposed to 1080*1.

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices 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!