From c7a860e6b68059d55e039cdceff7f642457cd927 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Wed, 24 Jan 2018 18:22:45 +0100
Subject: [PATCH] Fixed bug in interactive choice of the endogenous variables.

Bug introduced when we replaced the character arrays by cell of row character
arrays. Closes #1577.
---
 matlab/check_list_of_variables.m | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/matlab/check_list_of_variables.m b/matlab/check_list_of_variables.m
index 332372665..8fabffe54 100644
--- a/matlab/check_list_of_variables.m
+++ b/matlab/check_list_of_variables.m
@@ -31,8 +31,7 @@ function varlist = check_list_of_variables(options_, M_, varlist)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-%get uniques
-
+% Get uniques
 [junk1, junk2, index_uniques] = varlist_indices(varlist, M_.endo_names);
 varlist = varlist(index_uniques);
 
@@ -130,7 +129,7 @@ elseif isempty(varlist) && isempty(options_.endo_vars_for_moment_computations_in
                 elseif choice==2
                     varlist = options_.varobs;
                 elseif choice==3
-                    varlist = NaN;
+                    varlist = cell(0);
                 else
                     skipline()
                     disp('YOU HAVE TO ANSWER 1, 2 or 3!')
@@ -138,7 +137,7 @@ elseif isempty(varlist) && isempty(options_.endo_vars_for_moment_computations_in
                 end
             end
         end
-        if isnan(varlist)
+        if isempty(varlist)
             edit([M_.fname '.mod'])
         end
         skipline()
-- 
GitLab