필터 지우기
필터 지우기

How to extract year and month from attached string.

조회 수: 4 (최근 30일)
varunesh
varunesh 2019년 1월 10일
댓글: madhan ravi 2019년 1월 10일
I want to extract year and month from attached string data. Please help me.
Thank you so much in advance.
Regard's
Varunesh

채택된 답변

madhan ravi
madhan ravi 2019년 1월 10일
편집: madhan ravi 2019년 1월 10일
load('date.mat');
a=date{:,:};
b=regexp(a,'\T','split');
b=[b{:}];
B=datetime(b(1:2:end).','InputFormat','yyyy-MM-dd');
[year,month,day]=ymd(B);
  댓글 수: 3
varunesh
varunesh 2019년 1월 10일
Thank you so much. It is working.
Can you help me with another question? Please look once, If possible then please help me. a link is below.
madhan ravi
madhan ravi 2019년 1월 10일
Anytime :) , not sure if I can help with that though sorry.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2019년 1월 10일
times = datetime(date.datetime, 'InputFormat', 'yyyy-MM-dd''T''HH:mm:ss');
By the way, your times are not completely sorted.

카테고리

Help CenterFile Exchange에서 Time Series Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by