Cody

Solution 1574093

Submitted on 3 Jul 2018
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
inStr = 'Cedric loves regular expressions' ; output_correct = {'Cedric', 'regular'} ; assert(isequal(getWordsSameStartEnd(inStr),output_correct))

a = 1×4 cell array {'Cedric'} {'loves'} {'regular'} {'expressions'} a1 = 1×4 logical array 1 0 1 0 output = 0×0 empty cell array

Brace indexing is not supported for variables of this type. Error in getWordsSameStartEnd (line 7) output{ii} = a{ii}([a1{ii,:}]) Error in Test1 (line 3) assert(isequal(getWordsSameStartEnd(inStr),output_correct))

2   Fail
inStr = 'Single neuron Cedric, Anna-Maria, Andrei, a koala' ; output_correct = {'neuron', 'Cedric', 'Anna-Maria'} ; assert(isequal(getWordsSameStartEnd(inStr),output_correct))

a = 1×7 cell array {'Single'} {'neuron'} {'Cedric,'} {'Anna-Maria,'} {'Andrei,'} {'a'} {'koala'} a1 = 1×7 logical array 0 1 0 0 0 1 0 output = 0×0 empty cell array

Brace indexing is not supported for variables of this type. Error in getWordsSameStartEnd (line 7) output{ii} = a{ii}([a1{ii,:}]) Error in Test2 (line 3) assert(isequal(getWordsSameStartEnd(inStr),output_correct))

3   Fail
inStr = '__dEdiCaTeD__, REGULAR_EXPRESSION.. Rotor-1 and abracadabra' ; output_correct = { 'dEdiCaTeD', 'REGULAR', 'abracadabra'} ; assert(isequal(getWordsSameStartEnd(inStr),output_correct))

a = 1×5 cell array {'__dEdiCaTeD__,'} {'REGULAR_EXPRESSION..'} {'Rotor-1'} {'and'} {'abracadabra'} a1 = 1×5 logical array 0 0 0 0 1 output = 0×0 empty cell array

Brace indexing is not supported for variables of this type. Error in getWordsSameStartEnd (line 7) output{ii} = a{ii}([a1{ii,:}]) Error in Test3 (line 3) assert(isequal(getWordsSameStartEnd(inStr),output_correct))