Question: Write a function C = myMatSum ( A , B ) that computes the sum of two matrices A and B explicitly ( use a

Write a function C= myMatSum (A,B) that computes the sum of two matrices A and B explicitly (use a while loop and a for loop). It should output an error message when the sizes of the matrices don't match. For example:
myMatSum([12;34],[4321])
Error using myMatSum
Arrays have incompatible sizes for this operation.
myMatSum([12; 34],[43; 21])
ans =
5,5
5-5
Write a function C = myMatSum ( A , B ) that

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 Programming Questions!