Cody

Solution 1279546

Submitted on 1 Oct 2017 by Peng Liu
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))

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

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

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

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))

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))

Suggested Problems

More from this Author18