Cody

Problem 43706. Sum the rows

Solution 2626588

Submitted on 29 Jun 2020 by Ramesh Kumar V
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 = magic(4); y_correct = [34;34;34;34] assert(isequal(sum_the_rows(x),y_correct))

y_correct = 34 34 34 34 m = 4 n = 4 y = [] z = 34 z = 34 z = 34 z = 34

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

m = 7 n = 7 y = [] z = 7 z = 28 z = 84 z = 210 z = 462 z = 924 z = 1716

3   Pass
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 m = 3 n = 4 y = [] z = 16 z = 41 z = 9

Suggested Problems

More from this Author7

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!