MATLAB: Specify a format character vector in readtable

data importMATLAB

I ran "readtable" and got a following warning. Please advise how to specify a format character vector in readtable. It was not clear from the documentation.
Warning: Successfully read the date/time text using the format 'MM/dd/uuuu', but
their format is ambiguous and could also be 'dd/MM/uuuu'. Specify a format
character vector to avoid ambiguity.

Best Answer

Ah! That's an internal problem in that timerange calls datetime.
Unfortunately, there's a quality of implementation problem; TMW didn't provide the means to specify the date string format for timerange to pass on to its helper function.
Fortunately for your specific case being the common convention, it did make the proper choice but to avoid the warning message you will have to recode the input format to use a datetime value directly...
>> timerange(datetime('07/01/2003','format','MM/dd/yyyy'),datetime('10/30/2017','format','MM/dd/yyyy'))
ans =
timetable timerange subscript:
Select timetable rows with times in the half-open interval:
[01-Jul-2003 00:00:00, 30-Oct-2017 00:00:00)
See Select Timetable Data by Row Time and Variable Type.
>>
This is worth an official enhancement request to be able to write
timerange('07/01/2003','10/30/2017'},'format','MM/dd/yyyy')
to pass the format string on. Surprising TMW didn't do enough pre-release testing to have uncovered the issue and fixed it before release into the wild, but a lot of the datetime stuff really hasn't been fully implemented early on--I guess time-to-market outranks thoroughness and completion of features.