Cody

Solution 22380

Submitted on 1 Feb 2012 by Ben
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))

y = 1.00

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

y = 1.00 y = 3.00 y = 6.00 y = 11.00

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

y = 1.00 y = 3.00 y = 6.00 y = 11.00

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

y = 1.00 y = 3.00 y = 6.00 y = 10.00 y = 15.00 y = 21.00 y = 28.00 y = 36.00 y = 45.00 y = 55.00 y = 66.00 y = 78.00 y = 91.00 y = 105.00 y = 120.00 y = 136.00 y = 153.00 y = 171.00 y = 190.00 y = 210.00 y = 231.00 y = 253.00 y = 276.00 y = 300.00 y = 325.00 y = 351.00 y = 378.00 y = 406.00 y = 435.00 y = 465.00 y = 496.00 y = 528.00 y = 561.00 y = 595.00 y = 630.00 y = 666.00 y = 703.00 y = 741.00 y = 780.00 y = 820.00 y = 861.00 y = 903.00 y = 946.00 y = 990.00 y = 1035.00 y = 1081.00 y = 1128.00 y = 1176.00 y = 1225.00 y = 1275.00 y = 1326.00 y = 1378.00 y = 1431.00 y = 1485.00 y = 1540.00 y = 1596.00 y = 1653.00 y = 1711.00 y = 1770.00 y = 1830.00 y = 1891.00 y = 1953.00 y = 2016.00 y = 2080.00 y = 2145.00 y = 2211.00 y = 2278.00 y = 2346.00 y = 2415.00 y = 2485.00 y = 2556.00 y = 2628.00 y = 2701.00 y = 2775.00 y = 2850.00 y = 2926.00 y = 3003.00 y = 3081.00 y = 3160.00 y = 3240.00 y = 3321.00 y = 3403.00 y = 3486.00 y = 3570.00 y = 3655.00 y = 3741.00 y = 3828.00 y = 3916.00 y = 4005.00 y = 4095.00 y = 4186.00 y = 4278.00 y = 4371.00 y = 4465.00 y = 4560.00 y = 4656.00 y = 4753.00 y = 4851.00 y = 4950.00 y = 5050.00