The 5th case should be: C_correct = cat(3,A(:,:,1)*B,A(:,:,2)*B,A(:,:,3)*B); ??
I gave the solution which passes all given test cases, but I am sure it will fail, if there are multiple combinations of sizes of A and B.
I believe, to get a full-proof solution, more test cases are needed. Or such solution can work for limited combination of sizes of multidimensional matrices to be multiplied.
José Ramón, You are absolutely right. I will fix it.
Have a look in 20b! :)
1329 Solvers
Return elements unique to either input
554 Solvers
Remove the two elements next to NaN value
414 Solvers
Set some matrix elements to zero
290 Solvers
119 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!