Added a test for the number of variables in the data file.

time-shift
Stéphane Adjemian (Scylla) 2011-09-19 16:05:43 +02:00
parent c111fc1847
commit 9c0e559e30
1 changed files with 10 additions and 0 deletions

View File

@ -45,6 +45,16 @@ dataset_.info.ntobs = nobs;
dataset_.info.nvobs = rows(varobs);
dataset_.info.varobs = varobs;
% Test the number of variables in the database.
if dataset_.info.nvobs-size(rawdata,2)
disp(' ')
disp(['Declared number of observed variables = ' int2str(dataset.info.nvobs)])
disp(['Number of variables in the database = ' int2str(size(rawdata,2))])
disp(' ')
error(['Estimation can''t take place because the declared number of observed' ...
'variables doesn''t match the number of variables in the database.'])
end
rawdata = rawdata(first:(first+dataset_.info.ntobs-1),:);
% Take the log (or anything else) of the variables if needed