From 31cd80e9a91296a8eb74dbac6f7cdcc3abfc5705 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Sun, 19 Apr 2015 10:50:45 +0200 Subject: [PATCH] Fix crash in error message display of perfect_foresight_setup.m when more than one variable is not present in current period Concatenation otherwise crashes due to non-conformable matrices --- .../perfect_foresight_setup.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/matlab/perfect-foresight-models/perfect_foresight_setup.m b/matlab/perfect-foresight-models/perfect_foresight_setup.m index da03d46a6..081eaf887 100644 --- a/matlab/perfect-foresight-models/perfect_foresight_setup.m +++ b/matlab/perfect-foresight-models/perfect_foresight_setup.m @@ -34,8 +34,16 @@ global M_ options_ oo_ test_for_deep_parameters_calibration(M_); if size(M_.lead_lag_incidence,2)-nnz(M_.lead_lag_incidence(M_.maximum_endo_lag+1,:)) > 0 - mess = ['PERFECT_FORESIGHT_SETUP: error in model specification : variable ' M_.endo_names(find(M_.lead_lag_incidence(M_.maximum_lag+1,:)==0),:)]; - mess = [mess ' doesn''t appear as current variable.']; + mess = ['PERFECT_FORESIGHT_SETUP: error in model specification : the variable(s) ']; + var_list=M_.endo_names(find(M_.lead_lag_incidence(M_.maximum_lag+1,:)==0),:); + for i=1:size(var_list,1) + if i