How to extract Month string from day_Month_Year time variable and create a new quarterly time index?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Shubham Gupta
2019년 11월 7일
If I understand the question correctly, this should work :
Month_variable = datestr(datenum('Oct_01_2019'),'mm');
I hope it helps !
댓글 수: 2
Shubham Gupta
2019년 11월 8일
In that case, datevec() might be a better option.
Read more about it here.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!