Cody

Problem 42488. combine cells

Solution 1156857

Submitted on 8 Apr 2017 by H M Dipu Kabir
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
filetext = fileread('combineCells.m'); assert(isempty(strfind(filetext, 'for'))) assert(isempty(strfind(filetext, 'while')))

2   Pass
x = {{'cody';'players'};{'are';'great'}}; y_correct = {'cody';'players';'are';'great'}; assert(isequal(combineCells(x),y_correct))

z = cell {4×1 cell} y = 4×1 cell array 'cody' 'players' 'are' 'great'

3   Pass
x = {{'A';'B';'C'};{'D';'E'};{'F';'G';'H';'I';'J'}}; y_correct = {'A';'B';'C';'D';'E';'F';'G';'H';'I';'J'}; assert(isequal(combineCells(x),y_correct))

z = cell {10×1 cell} y = 10×1 cell array 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J'

4   Pass
x = {{'A';'B';'C'};{'D';'E'};{'F';'G';'H';'I';'J';'K'}}; y_correct = {'A';'B';'C';'D';'E';'F';'G';'H';'I';'J';'K'}; assert(isequal(combineCells(x),y_correct))

z = cell {11×1 cell} y = 11×1 cell array 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K'

5   Pass
x = {{'A';'B';'C';'toPreventLittleCheats'};{'D';'E'};{'F';'G';'H';'I';'J'}}; y_correct = {'A';'B';'C';'toPreventLittleCheats';'D';'E';'F';'G';'H';'I';'J'}; assert(isequal(combineCells(x),y_correct))

z = cell {11×1 cell} y = 11×1 cell array 'A' 'B' 'C' 'toPreventLittleCheats' 'D' 'E' 'F' 'G' 'H' 'I' 'J'

Suggested Problems

More from this Author67

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!