Question: Write a function with the header: function [D] = myMatMatMat (A, B, C) that implements nested for-loops to multiply A and B and then multiplies
Write a function with the header: function [D] = myMatMatMat (A, B, C) that implements nested for-loops to multiply A and B and then multiplies the product by C. If A and B are not compatible, myMatMatMat should return -1 for D. If (AB) is not compatible with C, myMatMatMat should return -2 for D. Do not use the colon operator or Matlabs built-in matrix multiplication operator (i.e., dont just type D = A*B*C; )
![Write a function with the header: function [D] = myMatMatMat (A, B,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2f5d34f704_67466f2f5d2cc562.jpg)

Problem 2: (5 Points) Write a function with the header: function [D] myMatMatMat (A, B, C) that implements nested for-loops to multiply A and B and then multiplies the product by C . If A and B are not compatible, myMatMatMat should return - for D. If (AB) is not compatible with C, myMatMatMat should return -2 for D Do not use the colon operator or Matlab's built-in matrix multiplication operator (i.e. don't just type D A*B*C) = 23 34 >> A=[35 39 41 41 18 39 34 41 28]; 39 27 12 21 >> B =[2 29 32 32 17 28 30 14 40 30 36 40 12 35 17 32 42 37 >>C=[34 14 23 19 4 19 17 5 11 34 19 39 26 39 28 29 35 23 35 myMatMatMat(A, B, C) ans 324774 292530 260118 289308 379402 353620 233938 308812 257596 241864 281420 357388 342436 226464 314648 277188 263022 276864 374524 360744 234058 295778 236776 232375 271187 342792 335305 220499 >A 135 23 34 41 41 39 6 27 12 39 4134 21 28]; B-2 29 17 30 36 32 28 32 30 5 14 19 34 35 40 17 40 12 C 134 32437 14 23 10 35 23 >myMatMatMat (A, B, c) 33 35 39 28 29 ans
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
