How to extract Month string from day_Month_Year time variable and create a new quarterly time index?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
mirewuti muhetaer
am 7 Nov. 2019
Kommentiert: Shubham Gupta
am 8 Nov. 2019
Hi, i have a time index in this following format: day_month_year, for example, Oct_01_2019, how will i extract the months and create a new variable of months or quarter?.
Thanks. .
0 Kommentare
Akzeptierte Antwort
Shubham Gupta
am 7 Nov. 2019
If I understand the question correctly, this should work :
Month_variable = datestr(datenum('Oct_01_2019'),'mm');
I hope it helps !
2 Kommentare
Shubham Gupta
am 8 Nov. 2019
In that case, datevec() might be a better option.
Read more about it here.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!