MATLAB: Datetime format using tabularTextDatastore

MATLABtabulartextdatastore datetime

I am importing a large csv file into a data table and I get the following warning:
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.
Is there a way to set a some global or pass through another variable to get it to stop setting the warning. ds = tabularTextDatastore(fileName,'DatetimeType','datetime','ReadVariableNames',1,'NumHeaderLines',0);
Looking in the tabularTextDatastore help there was no other variable to pass into the function that I could figure out.

Best Answer

Looks like you set the 'SelectedFormats' property to match the variables.
TabularTextDatastore Properties
...
SelectedFormats — Formats of selected variables
cell array of character vectors
Formats of the selected variables to read, specified as a cell array of character
vectors, where each character vector contains one conversion specifier. The variables
to read are indicated by the SelectedVariableNames property. The number of character
vectors in SelectedFormats must match the number of variables to read.
You can use the same conversion specifiers that the textscan function accepts,
including specifiers that skip literal text. However, you cannot use a conversion
specifier that skips a field. That is, the conversion specifier cannot include
an asterisk character (*).