I've noticed strange behaviour in the function datenum with MATLAB R2017a and above:
If you try to run:
date = datenum([""],'yyyymmdd');
We obtain a warning:
Warning: Usage of DATENUM with empty date character vectors or empty strings is not supported. Results may change in future versions.
date =
0x1 empty double column vector
But now if we run:
date = datenum(["","20181012"],'yyyymmdd')
We obtain:
date = 2x1:
737426 % which corresponds to 20190101
737345
So both times we give an empty string to datenum, but if the array contains multiple strings, the result is different. Why can an empty string be parsed when other strings are present, even another empty string, but not when on its own?