MATLAB: How to extract year and month from attached string.

date

I want to extract year and month from attached string data. Please help me.
Thank you so much in advance.
Regard's
Varunesh

Best Answer

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);