Cody

# Problem 43706. Sum the rows

Solution 1886819

Submitted on 29 Jul 2019
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
x = magic(4); y_correct = [34;34;34;34] assert(isequal(sum_the_rows(x),y_correct))

y_correct = 34 34 34 34

Error using sum Invalid option. Option must be 'double', 'native', 'default', 'omitnan', or 'includenan'. Error in sum_the_rows (line 2) sum(x,[],2) Error in Test1 (line 3) assert(isequal(sum_the_rows(x),y_correct))

2   Fail
x = pascal(7); y_correct =[7;28;84;210;462;924;1716]; assert(isequal(sum_the_rows(x),y_correct))

Error using sum Invalid option. Option must be 'double', 'native', 'default', 'omitnan', or 'includenan'. Error in sum_the_rows (line 2) sum(x,[],2) Error in Test2 (line 3) assert(isequal(sum_the_rows(x),y_correct))

3   Fail
x = [5 -1 7 5;3 10 23 5;0 -3 7 5] y_correct =[16;41;9]; assert(isequal(sum_the_rows(x),y_correct))

x = 5 -1 7 5 3 10 23 5 0 -3 7 5

Error using sum Invalid option. Option must be 'double', 'native', 'default', 'omitnan', or 'includenan'. Error in sum_the_rows (line 2) sum(x,[],2) Error in Test3 (line 3) assert(isequal(sum_the_rows(x),y_correct))