Cody

Solution 1983615

Submitted on 20 Oct 2019
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
C = {'abc' 'd' 'ef' 'ghij'}; iC = [1 1 1 2 3 3 4 4 4 4]; assert(isequal(cellSourceIndex(C),iC))

s = [] s = 3 s = 3 1 s = 3 1 2 s = 3 1 2 4 s = 3 1 2 4

Output argument "iC" (and maybe others) not assigned during call to "cellSourceIndex". Error in Test1 (line 3) assert(isequal(cellSourceIndex(C),iC))

2   Fail
C = {[1 2 3] [] 1 [] 2}; iC = [1 1 1 3 5]; assert(isequal(cellSourceIndex(C),iC))

s = [] s = 3 s = 3 0 s = 3 0 1 s = 3 0 1 0 s = 3 0 1 0 1 s = 3 0 1 0 1

Output argument "iC" (and maybe others) not assigned during call to "cellSourceIndex". Error in Test2 (line 3) assert(isequal(cellSourceIndex(C),iC))

3   Fail
assert(isequal(cellSourceIndex(num2cell(ones(3))),1:9))

s = [] s = 1 s = 1 1 s = 1 1 1 s = 1 1 1 1 s = 1 1 1 1 1 s = 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1 s = 1 1 1 1 1 1 1 1 1

Output argument "iC" (and maybe others) not assigned during call to "cellSourceIndex". Error in Test3 (line 1) assert(isequal(cellSourceIndex(num2cell(ones(3))),1:9))

4   Fail
assert(isequal(cellSourceIndex({[] [] [] 1}),4))

s = [] s = 0 s = 0 0 s = 0 0 0 s = 0 0 0 1 s = 0 0 0 1

Output argument "iC" (and maybe others) not assigned during call to "cellSourceIndex". Error in Test4 (line 1) assert(isequal(cellSourceIndex({[] [] [] 1}),4))

5   Fail
assert(isempty(cellSourceIndex({})))

s = [] s = []

Output argument "iC" (and maybe others) not assigned during call to "cellSourceIndex". Error in Test5 (line 1) assert(isempty(cellSourceIndex({})))

6   Fail
C = {struct('a',{1 2},'b',[]),struct('c',{1 2}),struct('d',{5 6 7 8})}; iC = [1 1 2 2 3 3 3 3]; assert(isequal(cellSourceIndex(C),iC))

s = [] s = 2 s = 2 2 s = 2 2 4 s = 2 2 4

Output argument "iC" (and maybe others) not assigned during call to "cellSourceIndex". Error in Test6 (line 3) assert(isequal(cellSourceIndex(C),iC))