Cody

# Problem 44328. Sum two matrices

Solution 1282435

Submitted on 6 Oct 2017 by Said BOUREZG
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
x = [1 2; 3 4]; x1 = [4 3; 2 1]; y_correct = 5*ones(2); assert(isequal(your_fcn_name(x, x1),y_correct))

ans = 5 5 5 5

2   Pass
x = ones(3,5); x1 = x; y_correct = 2*x; assert(isequal(your_fcn_name(x, x1),y_correct))

ans = 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

3   Pass
x = 1:10; x1 = 10:-1:1; y_correct = 11*ones(1,10); assert(isequal(your_fcn_name(x, x1),y_correct))

ans = 11 11 11 11 11 11 11 11 11 11

4   Pass
x = magic(3); x1 = flipud(fliplr(x)); y_correct = 10*ones(3); assert(isequal(your_fcn_name(x, x1),y_correct))

ans = 10 10 10 10 10 10 10 10 10

5   Pass
x = [1 5 7 9]; x1 = [3 -5 6 15]; y_correct = [4 0 13 24]; assert(isequal(your_fcn_name(x, x1),y_correct))

ans = 4 0 13 24

6   Pass
x = eye(4); x1 = fliplr(x); y_correct = [1,0,0,1;0,1,1,0;0,1,1,0;1,0,0,1]; assert(isequal(your_fcn_name(x, x1),y_correct))

ans = 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1