Suppose I have an AxBxC matrix X and a BxD matrix Y.
Is there a non-loop method by which I can multiply each of the C AxB matrices with Y?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do this in one line using the functions NUM2CELL to break the matrix
Xinto a cell array and CELLFUN to operate across the cells:The result
Zis a 1-by-C cell array where each cell contains an A-by-D matrix. If you wantZto be an A-by-D-by-C matrix, you can use the CAT function:NOTE: My old solution used MAT2CELL instead of NUM2CELL, which wasn’t as succinct: