Question: matlab write and test a function that manually calculates the multiplication of 2x2 matrices Write and test a function that manually calculates the multiplication of
Write and test a function that manually calculates the multiplication of two 2x2 matrices. You should accept two 2x2 matrices as input, and return one 2x2 matrix as your output. As an example, if the user enters a and b as follows, you would output c as shown: a= 3 4 c=a*b=[14 20 30 44 Note that matrix multiplication for a 2x2 is performed by multiplying the elements of the first row of A by the elements in the first column of B and summing the products. Then proceeding to multiply the elements of the first row of A by the elements of the second column of B and summing those products, etc. Here is a screenshot from Wikipedia for a 3x3 times a 3x3 matrix: Your function should be able to handle only 2x2 matrices. In other words, if the user enters any other size, you should output an error. To test your function, write a script that calls the function with 2 matrices for which you have hand- calculated the product. Then, compare the result of the function to your hand calculation. If the output is correct (matches your hand calculation), then output a message indicating that the test passed). If the output is incorrect (does not match your hand calculation), then output a message indicating that the test failed. For bonus cool-points, also indicate what the inputs were, what the expected output was, and what
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
