Cody

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

Solution 2128031

Submitted on 14 Feb 2020 by Asif Newaz
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 = {'I','love','MATLAB'}; y_correct = string({'I','love','MATLAB'}); assert(isequal(cell2str(x),y_correct))

y = "I" y = 1×2 string array "I" "love" y = 1×3 string array "I" "love" "MATLAB"

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

y = "I" y = 1×2 string array "I" <missing> y = 1×3 string array "I" <missing> <missing> y = 1×4 string array "I" <missing> <missing> "MATLAB"

3   Pass
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))

y = "I" y = 1×2 string array "I" <missing> y = 1×3 string array "I" <missing> "MATLAB" y = 2×3 string array "I" <missing> "MATLAB" <missing> <missing> <missing> y = 2×3 string array "I" <missing> "MATLAB" <missing> "love" <missing> y = 2×3 string array "I" <missing> "MATLAB" <missing> "love" "MATLAB" y = 3×3 string array "I" <missing> "MATLAB" <missing> "love" "MATLAB" "I" <missing> <missing> y = 3×3 string array "I" <missing> "MATLAB" <missing> "love" "MATLAB" "I" "love" <missing> y = 3×3 string array "I" <missing> "MATLAB" <missing> "love" "MATLAB" "I" "love" <missing>