MATLAB: Reshaping a vector of dates (2)

cell

Dear all, I have a cell column vector that contains the following elements
AAA={'AUGUST-SEPTEMBER 1999' ...
'OCTOBER-NOVEMBER 1999'...
'DECEMBER-JANUARY 2000'...
'FEBRUARY-MARCH 2000'...
'APRIL-MAY 2000'...
'JUNE-JULY 2000'}
I want to change that vector so as to have
AAA={'AS 1999'...
'ON 1999'...
'DJ 2000'...
'FM 2000'...
'AM 2000'...
'JJ 2000'}
Where AS for example stands for 'AUGUST-SEPTEMBER’
thanks
[EDITED, code formatted, Jan]

Best Answer

g = regexp(AAA,'(^\w)|(-\w)|( \d*)','match');
AAA = strrep(cellstr(cell2mat(cat(1,g{:}))),'-','');
EDIT