From cf2f2e4602f0fa0507a2ef1ffc039b7dcd7b389b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Mon, 25 Mar 2013 14:34:07 +0100
Subject: [PATCH] Adapt for change of ismember in MATLAB R2013a (cherry picked
 from commit feb0eb8a11fea4d31517ef9a745206279eee8f60)

---
 matlab/varlist_indices.m | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/matlab/varlist_indices.m b/matlab/varlist_indices.m
index a3936cdab..20ece2830 100644
--- a/matlab/varlist_indices.m
+++ b/matlab/varlist_indices.m
@@ -13,7 +13,7 @@ function [i_var,nvar] = varlist_indices(sublist,list)
 % SPECIAL REQUIREMENTS
 %    none
 
-% Copyright (C) 2010-2011 Dynare Team
+% Copyright (C) 2010-2013 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -32,7 +32,12 @@ function [i_var,nvar] = varlist_indices(sublist,list)
 
 % In Octave, ismember() doesn't operate on character arrays
 if ~exist('OCTAVE_VERSION')
-    [check,i_var] = ismember(sublist,list,'rows');
+    if isempty(sublist)
+        check = [];
+        i_var = [];
+    else
+        [check,i_var] = ismember(sublist,list,'rows');
+    end
 else
     check = [];
     i_var = [];
-- 
GitLab