create date from three column vectors

2 次查看(过去 30 天)
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

回答(1 个)

Aletta Wilbrink
Aletta Wilbrink 2018-4-24
编辑:Aletta Wilbrink 2018-4-24
Is this wat you want?
m = datevec(month,'mmmm');
d = datetime(year,m(2),day);

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by