Cody

Solution 1703677

Submitted on 7 Jan 2019 by Mehmet OZC
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; y_correct = 1; assert(isequal(add_consecutive_integers(x),y_correct))

y = 0 y = 1

2   Pass
x = 1:10; y_correct = sum(x); assert(isequal(add_consecutive_integers(x),y_correct))

y = 0 y = 1 y = 3 y = 6 y = 10 y = 15 y = 21 y = 28 y = 36 y = 45 y = 55

3   Pass
x = 5:10; y_correct = sum(x); assert(isequal(add_consecutive_integers(x),y_correct))

y = 0 y = 5 y = 11 y = 18 y = 26 y = 35 y = 45

4   Pass
x = 50:100; y_correct = sum(x); assert(isequal(add_consecutive_integers(x),y_correct))

y = 0 y = 50 y = 101 y = 153 y = 206 y = 260 y = 315 y = 371 y = 428 y = 486 y = 545 y = 605 y = 666 y = 728 y = 791 y = 855 y = 920 y = 986 y = 1053 y = 1121 y = 1190 y = 1260 y = 1331 y = 1403 y = 1476 y = 1550 y = 1625 y = 1701 y = 1778 y = 1856 y = 1935 y = 2015 y = 2096 y = 2178 y = 2261 y = 2345 y = 2430 y = 2516 y = 2603 y = 2691 y = 2780 y = 2870 y = 2961 y = 3053 y = 3146 y = 3240 y = 3335 y = 3431 y = 3528 y = 3626 y = 3725 y = 3825

5   Pass
assessFunctionAbsence('sum','Filename','add_consecutive_integers')

Suggested Problems