MATLAB Answers

Matrix dimensions must agree.

6 views (last 30 days)
mike moran
mike moran on 23 Mar 2016
Commented: mike moran on 23 Mar 2016
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';

  0 Comments

Sign in to comment.

Answers (1)

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

  3 Comments

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

Sign in to comment.

Sign in to answer this question.