Cody

Solution 454370

Submitted on 12 Jun 2014
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   Fail
%% sum_up = 5*rand; % sum of array should be this n = randi(10); %number of elements in array sum_array = []; for times = 1:100 for i = 1:n sum_array(i,1) = fill_array_sum_up_to(sum_up,n,sum_array); end checksum(times) = all(diff(sort(sum_array))); end assert(all(checksum));

Error: Attempted to access x(8); index out of bounds because numel(x)=7.