Cody

Solution 1880617

Submitted on 22 Jul 2019 by Ugo Belfiore
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(vecsum(x),y_correct))

temp = 0 temp = 1 y = 1

2   Pass
x = [1 2 3 5]; y_correct = 11; assert(isequal(vecsum(x),y_correct))

temp = 0 temp = 1 temp = 3 temp = 6 temp = 11 y = 11

3   Pass
x = [1 2 3 5]; y_correct = 11; assert(isequal(vecsum(x),y_correct))

temp = 0 temp = 1 temp = 3 temp = 6 temp = 11 y = 11

4   Pass
x = 1:100; y_correct = 5050; assert(isequal(vecsum(x),y_correct))

temp = 0 temp = 1 temp = 3 temp = 6 temp = 10 temp = 15 temp = 21 temp = 28 temp = 36 temp = 45 temp = 55 temp = 66 temp = 78 temp = 91 temp = 105 temp = 120 temp = 136 temp = 153 temp = 171 temp = 190 temp = 210 temp = 231 temp = 253 temp = 276 temp = 300 temp = 325 temp = 351 temp = 378 temp = 406 temp = 435 temp = 465 temp = 496 temp = 528 temp = 561 temp = 595 temp = 630 temp = 666 temp = 703 temp = 741 temp = 780 temp = 820 temp = 861 temp = 903 temp = 946 temp = 990 temp = 1035 temp = 1081 temp = 1128 temp = 1176 temp = 1225 temp = 1275 temp = 1326 temp = 1378 temp = 1431 temp = 1485 temp = 1540 temp = 1596 temp = 1653 temp = 1711 temp = 1770 temp = 1830 temp = 1891 temp = 1953 temp = 2016 temp = 2080 temp = 2145 temp = 2211 temp = 2278 temp = 2346 temp = 2415 temp = 2485 temp = 2556 temp = 2628 temp = 2701 temp = 2775 temp = 2850 temp = 2926 temp = 3003 temp = 3081 temp = 3160 temp = 3240 temp = 3321 temp = 3403 temp = 3486 temp = 3570 temp = 3655 temp = 3741 temp = 3828 temp = 3916 temp = 4005 temp = 4095 temp = 4186 temp = 4278 temp = 4371 temp = 4465 temp = 4560 temp = 4656 temp = 4753 temp = 4851 temp = 4950 temp = 5050 y = 5050

Suggested Problems

More from this Author95