Matlab "missing" values not clear
Show older comments
Matlab holds some types of "<missing>" values in its string array. For instance
b =
3×3 string array
"I" <missing> "MATLAB"
<missing> "love" "MATLAB"
"I" "love" <missing>
when I access each element of the array
b(1)
ans =
string
"I"
b{1}
ans =
I
b(2)
ans =
string
<missing>
b{2}
what type of value is "missing", and why can't it simply be an empty character vector?
2 Comments
Stephen23
on 23 Mar 2017
@Temitope Akinpelu: how did you create the variable b ?
Walter Roberson
on 23 Mar 2017
Edited: Guillaume
on 23 Mar 2017
Accepted Answer
More Answers (1)
Jan
on 23 Mar 2017
"Missing" means, that the string was not defined before. An empty string would be a defined string already. This is something completely different.
With cell arrays an equivalent method was implemented for cell arrays, but not visible from the Matlab layer:
C = cell(1, 5)
C{1}
Now the contents of C{1} is treated as empty matrix [], but internally the element contains a NULL pointer. From the MEX level this must be considered explicitely - with the advantage that it can be distinguished also.
Categories
Find more on Characters and Strings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!