From 55399a5dc5dbefcdf850a4137391e2b762c79978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Mon, 24 Jan 2011 15:20:30 -0500 Subject: [PATCH] Compatibility fix for Octave: under Octave, union() called on a column vector and a scalar returns a row vector, hence the need to add the 'rows' option --- matlab/dynare_estimation_1.m | 4 ++-- matlab/dynare_estimation_init.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m index 8b0d238ab..9e6c441cf 100644 --- a/matlab/dynare_estimation_1.m +++ b/matlab/dynare_estimation_1.m @@ -12,7 +12,7 @@ function dynare_estimation_1(var_list_,dname) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2003-2010 Dynare Team +% Copyright (C) 2003-2011 Dynare Team % % This file is part of Dynare. % @@ -196,7 +196,7 @@ for i=1:n_varobs k1 = [k1 strmatch(deblank(options_.varobs(i,:)),M_.endo_names, 'exact')]; end % Define union of observed and state variables -k2 = union(var_obs_index',[dr.nstatic+1:dr.nstatic+dr.npred]'); +k2 = union(var_obs_index',[dr.nstatic+1:dr.nstatic+dr.npred]', 'rows'); % Set restrict_state to postion of observed + state variables in expanded state vector. bayestopt_.restrict_var_list = k2; % set mf0 to positions of state variables in restricted state vector for likelihood computation. diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index e1ea40ccb..b7a470e66 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -14,7 +14,7 @@ function [data,rawdata]=dynare_estimation_init(var_list_, igsa) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2003-2007 Dynare Team +% Copyright (C) 2003-2011 Dynare Team % % This file is part of Dynare. % @@ -160,7 +160,7 @@ for i=1:n_varobs k1 = [k1 strmatch(deblank(options_.varobs(i,:)),M_.endo_names, 'exact')]; end % union of observed and state variables -k2 = union(k',[dr.nstatic+1:dr.nstatic+dr.npred]'); +k2 = union(k',[dr.nstatic+1:dr.nstatic+dr.npred]', 'rows'); % set restrict_state to postion of observed + state variables % in expanded state vector