From 55205eb6c24665b7d5f45e3deeb172a1b113df13 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Fri, 7 Apr 2017 12:05:29 +0200
Subject: [PATCH] clean up horzcat

---
 src/@dates/horzcat.m | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/@dates/horzcat.m b/src/@dates/horzcat.m
index c748637..ed00e1f 100644
--- a/src/@dates/horzcat.m
+++ b/src/@dates/horzcat.m
@@ -17,7 +17,7 @@ function B = horzcat(varargin) % --*-- Unitary tests --*--
 %
 %  Defines a dates object D containing the dates appearing in A, B and C.
     
-% Copyright (C) 2013 Dynare Team
+% Copyright (C) 2013-2017 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -38,12 +38,8 @@ if ~all(cellfun(@isdates,varargin))
     error('dates::horzcat: All input arguments must be dates objects.')
 end
 
-n = nargin;
 B = varargin{1};
-
-if isequal(n,1), return, end
-
-for i=2:n
+for i=2:nargin
     C = varargin{i};
     if isequal(B.freq,C.freq)
         if ~isempty(C)
-- 
GitLab