Cody

Solution 1914766

Submitted on 28 Aug 2019 by Natasha Evans
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))

sum = 0 sum = 1 y = 1

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

sum = 0 sum = 1 y = 1 sum = 3 y = 3 sum = 6 y = 6 sum = 11 y = 11

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

sum = 0 sum = 1 y = 1 sum = 3 y = 3 sum = 6 y = 6 sum = 11 y = 11

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

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

Suggested Problems

More from this Author95