create date from three column vectors

Hello everyone,
I have three column vectors. The first one is the number of the day (double vector), the second one is the name of the month(cell vector eg. March) and the third one is the year (double vector).
How can I create a date combining these three vectors in format 2018-03-01?
Thank you Vanessa

Antworten (1)

Aletta Wilbrink
Aletta Wilbrink am 24 Apr. 2018
Bearbeitet: Aletta Wilbrink am 24 Apr. 2018

0 Stimmen

Is this wat you want?
m = datevec(month,'mmmm');
d = datetime(year,m(2),day);

2 Kommentare

Vanessa
Vanessa am 24 Apr. 2018
Thank you!!

This might be useful:

m(:,2)

Melden Sie sich an, um zu kommentieren.

Kategorien

Tags

Gefragt:

am 24 Apr. 2018

Kommentiert:

am 24 Apr. 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by