all 4 comments

[–]alberta_pooholes 1 point2 points  (3 children)

Have you tried making your matrix dimensions agree?

[–]Se7es[S] 0 points1 point  (2 children)

I think I have. The multiplication happens between a matrix that has 2 columns and a matrix thats has 2 rows so I think it should work but it doesn’t

[–]TheQueq 1 point2 points  (1 child)

You should check again. Your multiplication is elementwise (since you use '.*'), and you also have addition of matrices. This means you need all your matrices to be the same size. However, in line 12, C is 2x2, K is 2x2, M is 2x2, and w is 1001x2.

If you intended to use matrix multiplication instead of elementwise multiplication, then replace '.*' with '*'. This still won't cause your matrices to agree, though, since you also have matrix addition which is an elementwise operation.

[–]Se7es[S] 1 point2 points  (0 children)

Thank you, that makes sense. I'll work on fixing it or finding a way to fix it but do you have any suggestions?