Problem 43673. String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array
String array and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array of text data. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.
The Part 2 assuming no missing values in the input string array is a good starting point. In this problem, the missing values for string arrays, denoted < missing >, need to be converted to the missing values for cell arrays, denoted {''} (i.e., cell of empty character).
Refer to the R2016b documentation for more information on the missing values for different data types.
Example:
Input:
>> x = string({'I','love'}); x(4) = 'MATLAB'
x =
1×4 string array
"I" "love" <missing> "MATLAB"
Output:
>> y = {'I', 'love', '', 'MATLAB'}
y =
1×3 cell array
'I' 'love' '' '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 Solvers115
Suggested Problems
-
Flag largest magnitude swings as they occur
688 Solvers
-
Find nearest prime number less than input number
1013 Solvers
-
Use R2016b Text Manipulations to Fix These Addresses (Part 1)
119 Solvers
-
Write c^3 as sum of two squares a^2+b^2
327 Solvers
-
11040 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!