Ivan
Ivan

Reputation: 7746

Convert matrix of char to column vector of date

I have a function that expects dates to be in column vector 1x2 of DateTime. If my data is in this 2x20 of char like this, [I am using two values to make it simple - the answer should work for any number of dates char-strings-dates]

2x20 of char

    20-Sep-2017 15:35:00
    20-Sep-2017 15:40:00

How do I convert to

Columns 1 through 2 of DateTime

    20-Sep-2017 15:35:00  20-Jan-2017 15:40:00

Upvotes: 0

Views: 59

Answers (1)

Ivan
Ivan

Reputation: 7746

t = datetime(datesStrings(1:end,:))
t = t'

Upvotes: 1

Related Questions