Question: 2. Write a user-defined function to add and multiply two matrices without using the MATLAB matrix-wise+ and operations. The function should have the two matrices

2. Write a user-defined function to add and multiply two matrices without using the MATLAB matrix-wise+ and operations. The function should have the two matrices as input, check whether the addition and multiplication operations are valid for the given matrices and if valid, manually compute the operation (using for-loops) and present the output matrix. If the operations are not valid, the function should print a statement to that effect. Print out the results of the function using inputs [A],[B], [A],[C] and [C],A (20 marks) 2. Write a user-defined function to add and multiply two matrices without using the MATLAB matrix-wise+ and operations. The function should have the two matrices as input, check whether the addition and multiplication operations are valid for the given matrices and if valid, manually compute the operation (using for-loops) and present the output matrix. If the operations are not valid, the function should print a statement to that effect. Print out the results of the function using inputs [A],[B], [A],[C] and [C],A (20 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
