matrix product different sizes

I have three matrices, A of size 46-by-46 and B of size 36-by-36, C of size 36-by-10. I need to compute A*B*C
How would I do it ? Doing ans=A*B*C, can't work out and hint wrong
Can I use the if sentence to solve this problem?

 Accepted Answer

Jan
Jan on 1 Mar 2021
Edited: Jan on 1 Mar 2021
The multiplication of a 36-by-36 and a 36-by-10 matrix is mathematically defined and creates a 36-by-10 matrix. But you cannot multiply this with a 46-by-46 matrix.
The readers cannot guess, what you want as result of this, so there is no chance to know, if an if statement would be useful.
What do you expect as result?
By the way, please do not explain the error message in other words, but post a complete copy of the original message, when you discuss in the forum.

1 Comment

many thanks for the answer and suggestion!

Sign in to comment.

More Answers (0)

Asked:

on 1 Mar 2021

Commented:

on 1 Mar 2021

Community Treasure Hunt

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

Start Hunting!