Cody

# Problem 42519. Sum my indices

Solution 2137156

Submitted on 22 Feb 2020
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   Fail
M = 1; N = 1; y_correct = [2]; assert(isequal(sumMyIndices(M,N),y_correct))

y = 1

Assertion failed.

2   Fail
M = 1; N = 2; y_correct = [2,3]; assert(isequal(sumMyIndices(M,N),y_correct))

Unable to perform assignment because the left and right sides have a different number of elements. Error in sumMyIndices (line 4) y(rows) = ones(1,column); Error in Test2 (line 4) assert(isequal(sumMyIndices(M,N),y_correct))

3   Fail
M = 3; N = 2; y_correct = [2,3; 3,4; 4,5]; assert(isequal(sumMyIndices(M,N),y_correct))

Unable to perform assignment because the left and right sides have a different number of elements. Error in sumMyIndices (line 4) y(rows) = ones(1,column); Error in Test3 (line 4) assert(isequal(sumMyIndices(M,N),y_correct))

4   Fail
M = 3; N = 3; y_correct = [2,3,4; 3,4,5; 4,5,6]; assert(isequal(sumMyIndices(M,N),y_correct))

Unable to perform assignment because the left and right sides have a different number of elements. Error in sumMyIndices (line 4) y(rows) = ones(1,column); Error in Test4 (line 4) assert(isequal(sumMyIndices(M,N),y_correct))

5   Fail
M = 4; N = 5; y_correct = [ 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9 ]; assert(isequal(sumMyIndices(M,N),y_correct))

Unable to perform assignment because the left and right sides have a different number of elements. Error in sumMyIndices (line 4) y(rows) = ones(1,column); Error in Test5 (line 9) assert(isequal(sumMyIndices(M,N),y_correct))

6   Fail
M = 5; N = 8; y_correct = [ 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 4 5 6 7 8 9 10 11 5 6 7 8 9 10 11 12 6 7 8 9 10 11 12 13 ]; assert(isequal(sumMyIndices(M,N),y_correct))

Unable to perform assignment because the left and right sides have a different number of elements. Error in sumMyIndices (line 4) y(rows) = ones(1,column); Error in Test6 (line 10) assert(isequal(sumMyIndices(M,N),y_correct))