Cody

Solution 578102

Submitted on 9 Feb 2015 by goc3
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 1 1 2 2 3 3 3 3]; y=[10 52 12 58 21 43 89 27 98]; c={[10 52 12],[58 21],[43 89 27 98]}; assert(isequal(split_array(x,y),c))

c = [] [] [] c = [1x3 double] [] [] c = [1x3 double] [1x2 double] [] c = [1x3 double] [1x2 double] [1x4 double]

2   Pass
%% x=1:5; c=num2cell(1:5); assert(isequal(split_array(x,x),c));

c = [] [] [] [] [] c = [1] [] [] [] [] c = [1] [2] [] [] [] c = [1] [2] [3] [] [] c = [1] [2] [3] [4] [] c = [1] [2] [3] [4] [5]

3   Pass
%% x=[1 1 1 1 1 2 3 3 3 3 3]; y='Hello world'; c={'Hello' ' ' 'world'} assert(isequal(split_array(x,y),c));

c = 'Hello' ' ' 'world' c = [] [] [] c = 'Hello' [] [] c = 'Hello' ' ' [] c = 'Hello' ' ' 'world'

Suggested Problems