String array and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data.
The Part 1 assuming no missing values in the input cell array is a good starting point. In this problem, the missing values for cell array of character vectors, denoted {''} (i.e., cell of empty character), need to be converted to the missing values for string arrays, denoted < missing >.
Refer to the R2016b documentation for more information on the missing values for different data types.
Example:
Input:
>> x = {'I', '', '', 'MATLAB'}
x =
1×4 cell array
'I' '' '' 'MATLAB'
Output:
>> y = string('I'); y(4) = 'MATLAB'
y =
1×4 string array
"I" <missing> <missing> "MATLAB"
Related Problems in this series:
- String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values
- String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values
- String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array
- String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers121
Suggested Problems
-
7231 Solvers
-
Back to basics 22 - Rotate a matrix
932 Solvers
-
899 Solvers
-
980 Solvers
-
Is this triangle right-angled?
6528 Solvers
More from this Author28
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
very cool question: learn some new tricks, and get 10 points, why not?!
Hint to spare the pain : string(NaN)==[]