Question: Write a polymorphic function called 'program that accepts two matrices, checks if their dimensions are compatible, which means the number of columns in the first

 Write a polymorphic function called 'program that accepts two matrices, checks

Write a polymorphic function called 'program that accepts two matrices, checks if their dimensions are compatible, which means the number of columns in the first matrix is the same as the number of rows in the second matrix, and in return displays their product and prints the summation of the product's elements if the caller wishes. If only one matrix is given by the caller, the function will multiply that by its transpose matrix. For the matrices C- [3 0; -2-4; 1-51. D- [-23 01: 1-49 0], if you want to see, e.g., the second row of A, you use A(2,). MATLAB will print -2 4 If you want to see the third column of D, you use DC 3). MATLAB will print 0 9 Now, if you want to multiply the second row of C by the third column of D, you use C(2,)*D(:,3). MATLAB will multiply the corresponding pairs of elements one by one and add them up

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!