Matrix dimensions must agree.

I am trying to multiply the same matrix by the transpose of itself and it is giving me the error of matrix dimensions must agree. Code: XX=X.*X';

Answers (1)

Rick Rosson
Rick Rosson on 23 Mar 2016
Try using * instead of .*

3 Comments

that will not work because X is a matrix of 135x100, therefore would need to use element by element multiplication.
Have you tried it?
I figured it out. My matrix was in uint8 and it needed to be in double.

Sign in to comment.

Categories

Asked:

on 23 Mar 2016

Commented:

on 23 Mar 2016

Community Treasure Hunt

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

Start Hunting!