フィルターのクリア

create date from three column vectors

1 回表示 (過去 30 日間)
Vanessa
Vanessa 2018 年 4 月 24 日
コメント済み: Stephen23 2018 年 4 月 24 日
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 件のコメント
Pawel Jastrzebski
Pawel Jastrzebski 2018 年 4 月 24 日

Have you tried using:

サインインしてコメントする。

回答 (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);
  2 件のコメント
Vanessa
Vanessa 2018 年 4 月 24 日
Thank you!!
Stephen23
Stephen23 2018 年 4 月 24 日

This might be useful:

m(:,2)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by