if true[Data,~,~] = xlsread('CRSP_daily','WRDS');Data(:,1) = datenum(num2str(Data(:,1),'yyyymmdd')); /define start and end datestart_date_monthly = datestr('1962-01-01');end_date_monthly = datestr('2016-12-30');Erase = (Data(:,1) < datenum(start_date_monthly) |... Data(:,1) > datenum(end_date_monthly));Data(Erase,:) = [];end
The first column of "Data" consists of dates in this format: "19271214" .. But I still seems to get an error saying the 'yyyymmdd' is an invalid format.
Any suggestions?
Best Answer