How to extract year and month from attached string.
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to extract year and month from attached string data. Please help me.
Thank you so much in advance.
Regard's
Varunesh
0 commentaires
Réponse acceptée
madhan ravi
le 10 Jan 2019
Modifié(e) : madhan ravi
le 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 commentaires
Plus de réponses (1)
Walter Roberson
le 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 commentaires
Voir également
Catégories
En savoir plus sur Dates and Time dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!