How to extract year and month from attached string.
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
varunesh
am 10 Jan. 2019
Kommentiert: madhan ravi
am 10 Jan. 2019
I want to extract year and month from attached string data. Please help me.
Thank you so much in advance.
Regard's
Varunesh
0 Kommentare
Akzeptierte Antwort
madhan ravi
am 10 Jan. 2019
Bearbeitet: madhan ravi
am 10 Jan. 2019
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 Kommentare
Weitere Antworten (1)
Walter Roberson
am 10 Jan. 2019
times = datetime(date.datetime, 'InputFormat', 'yyyy-MM-dd''T''HH:mm:ss');
By the way, your times are not completely sorted.
0 Kommentare
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!