Cody

Problem 1899. Convert a Cell Array into an Array

Solution 2721357

Submitted on 21 Jul 2020 by mohsen
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={'01', '56'; '234', '789'}; y_correct = '0123456789'; assert(isequal(your_fcn_name(x),y_correct));

p = 1×1 cell array {'01'} p = 1×2 cell array {'01'} {'234'} p = 1×3 cell array {'01'} {'234'} {'56'} p = 1×4 cell array {'01'} {'234'} {'56'} {'789'} y = '0123456789'

2   Pass
x={'' 'a' '1'; 'AA' 'BB' 'CC'; 'dog' 'cat' 'car'}; y_correct='AAdogaBBcat1CCcar'; assert(isequal(your_fcn_name(x),y_correct));

p = 1×1 cell array {0×0 char} p = 1×2 cell array {0×0 char} {'AA'} p = 1×3 cell array {0×0 char} {'AA'} {'dog'} p = 1×4 cell array {0×0 char} {'AA'} {'dog'} {'a'} p = 1×5 cell array {0×0 char} {'AA'} {'dog'} {'a'} {'BB'} p = 1×6 cell array {0×0 char} {'AA'} {'dog'} {'a'} {'BB'} {'cat'} p = 1×7 cell array {0×0 char} {'AA'} {'dog'} {'a'} {'BB'} {'cat'} {'1'} p = 1×8 cell array {0×0 char} {'AA'} {'dog'} {'a'} {'BB'} {'cat'} {'1'} {'CC'} p = 1×9 cell array {0×0 char} {'AA'} {'dog'} {'a'} {'BB'} {'cat'} {'1'} {'CC'} {'car'} y = 'AAdogaBBcat1CCcar'

3   Pass
x={'We' 'do' ;'ll ' 'ne.'}; y_correct='Well done.'; assert(isequal(your_fcn_name(x),y_correct));

p = 1×1 cell array {'We'} p = 1×2 cell array {'We'} {'ll '} p = 1×3 cell array {'We'} {'ll '} {'do'} p = 1×4 cell array {'We'} {'ll '} {'do'} {'ne.'} y = 'Well done.'

Suggested Problems

More from this Author11

Community Treasure Hunt

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

Start Hunting!