You can subtract one from the year field:
>> Vend = clock;
>> Nend = datenum(Vend);
>> Nbeg = datenum([Vend(1)-1,Vend(2:end)]);
>> Nall = Nbeg:Nend;
>> Vall = datevec(Nall);
You might also want to adjust Nbeg by one, depending on whether you want to include start on the same date as the period ends on.
EDIT this code gives just first of each month, over the past twelve months (regardless of the end month):
>> Vend = clock;
>> Nbeg = datenum([Vend(1)-1,1+Vend(2),1]);
>> Vbeg = datevec(Nbeg);
>> Nall = datenum(Vbeg(1),Vbeg(2)+(11:-1:0),1);
>> datestr(Nall)
ans =
01-Nov-2015
01-Oct-2015
01-Sep-2015
01-Aug-2015
01-Jul-2015
01-Jun-2015
01-May-2015
01-Apr-2015
01-Mar-2015
01-Feb-2015
01-Jan-2015
01-Dec-2014
Best Answer