From 03250208c0d9fc65bccc0bf8c4e66cfc63edc399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Sat, 17 May 2014 16:38:55 +0200 Subject: [PATCH] Test that each dseries object contains only one variable. --- matlab/utilities/dseries/from.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/matlab/utilities/dseries/from.m b/matlab/utilities/dseries/from.m index 5d1a17b4e..e0393d4c2 100644 --- a/matlab/utilities/dseries/from.m +++ b/matlab/utilities/dseries/from.m @@ -143,7 +143,7 @@ number_of_variables = size(leadlagtable,1); % Test that all the involved variables are available dseries objects. Also check that % these time series are defined over the time range given by d1 and d2 (taking care of -% the lags and leads). +% the lags and leads) and check that each object is a singleton for i=1:number_of_variables current_variable = leadlagtable{i,1}; try @@ -154,6 +154,10 @@ for i=1:number_of_variables if ~isdseries(var) error(['dseries::from: Variable ' current_variable ' is not a dseries object!']) else + if var.vobs>1 + msg = sprintf('dseries::from: Object %s must contain only one variable!\n',current_variable); + error(msg) + end if d1