%% Date and Time from String Array
% Starting in R2016b, you can create string arrays with the string function and convert them to datetime values.

str = string({'2016-03-24','2016-04-19'})

%
% Convert the strings, specifying the input format as yyyy-MM-dd. The format must be specified as a character vector, even though str is a string array.

t = datetime(str,'InputFormat','yyyy-MM-dd')

% Copyright 2012 The MathWorks, Inc.