I need to generate a rolling 1 year list of dates. I've tried using:
A=datevec(now);DList=datenum(A(1), A(2):-1:A(2)-12, eomday(A(1), A(2)));
which will make the list I want as long as the current month is December, however it currently is not. So I get a list that goes back from November 2015 and then has multiple entries for Jan 2015 as it doesn't roll back to 2014.
Is there a straight forward way to get what I need? I don't have access to the financial toolbox so any of the functions included in it are out for me.
Thanks, Ben
Best Answer