Cody

# Problem 43674. String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array

Solution 1859964

Submitted on 27 Jun 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
x = {'I','love','MATLAB'}; y_correct = string({'I','love','MATLAB'}); assert(isequal(cell2str(x),y_correct))

The following error occurred converting from string to cell: Conversion to cell from string is not possible. Error in cell2str (line 2) x(ismissing(x))=string(NaN); Error in Test1 (line 3) assert(isequal(cell2str(x),y_correct))

2   Fail
x = {'I', '', '', 'MATLAB'}; y_correct = string('I'); y_correct(4) = 'MATLAB'; assert(isequaln(cell2str(x),y_correct))

The following error occurred converting from string to cell: Conversion to cell from string is not possible. Error in cell2str (line 2) x(ismissing(x))=string(NaN); Error in Test2 (line 3) assert(isequaln(cell2str(x),y_correct))

3   Fail
x = {'I', '', 'MATLAB' '', 'love', 'MATLAB' 'I', 'love', '' }; y_correct = [string('I'), string(NaN), string('MATLAB') string(NaN), string('love'), string('MATLAB') string('I'), string('love'), string(NaN) ]; assert(isequaln(cell2str(x),y_correct))

The following error occurred converting from string to cell: Conversion to cell from string is not possible. Error in cell2str (line 2) x(ismissing(x))=string(NaN); Error in Test3 (line 7) assert(isequaln(cell2str(x),y_correct))