From 8568292fcd014f1cb51d1a53b42f70c2976aca23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Mon, 4 Nov 2013 19:13:53 +0100 Subject: [PATCH] Fixed bug that pops up when adding an empty dates object with a non empty dates object. --- matlab/@dates/plus.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/@dates/plus.m b/matlab/@dates/plus.m index 88c038cae..d4898c240 100644 --- a/matlab/@dates/plus.m +++ b/matlab/@dates/plus.m @@ -23,7 +23,7 @@ function C = plus(A,B) % --*-- Unitary tests --*-- if isa(A,'dates') && isa(B,'dates') % Concatenate dates objects without removing repetitions if A and B are not disjoint sets of dates. - if ~isequal(A.freq,B.freq) + if ~isequal(A.freq,B.freq) && A.ndat>0 && B.ndat>0 error(['dates::plus: Input arguments ''' inputname(1) ''' and ''' inputname(2) ''' must have common frequencies!']) end if isempty(B)