dynDate --> dates in load_xls_file_data.

time-shift
Stéphane Adjemian (Charybdis) 2013-10-16 12:30:14 +02:00
parent 73df682eb8
commit f28bc166f6
1 changed files with 11 additions and 4 deletions

View File

@ -9,7 +9,7 @@ function [freq, init, data, varlist] = load_xls_file_data(file, sheet, range)
%
% OUTPUTS
% o freq integer scalar (1, 4, 12 or 52), code for frequency.
% o init dynDate object, initial date of the sample.
% o init dates object, initial date of the sample.
% o data matrix of doubles, the raw data.
% o varlist cell of strings (column), names of the variables in the database.
%
@ -89,7 +89,7 @@ end
% Output initialization.
freq = 1;
init = dynDate(1);
init = dates(1,1);
varlist = [];
data = num;
@ -100,8 +100,15 @@ if ~notime
else
first_date = txt{1,1};
end
init = dynDate(first_date);
freq = init.freq;
if isnumeric(first_date) && isint(first_date)
first_date = [num2str(first_date) 'Y'];
end
if isdate(first_date)
init = dates(first_date);
freq = init.freq;
else
error('load_xls_file_data: I am not able to read the dates!')
end
end
% Update varlist.