diff --git a/matlab/+mom/run.m b/matlab/+mom/run.m index 9c8607510..370d46ffb 100644 --- a/matlab/+mom/run.m +++ b/matlab/+mom/run.m @@ -1007,3 +1007,10 @@ if isoctave else warning on end + +if isoctave && isfield(options_, 'prior_restrictions') && ... + isfield(options_.prior_restrictions, 'routine') + % Octave crashes if it tries to save function handles (to the _results.mat file) + % See https://savannah.gnu.org/bugs/?43215 + options_.prior_restrictions.routine = []; +end diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m index a790d8a87..51287f6c2 100644 --- a/matlab/dynare_estimation.m +++ b/matlab/dynare_estimation.m @@ -229,3 +229,9 @@ options_.mode_file = mode_file0; %reset stored mode-file to user defined one (and in case it was only set by the recursive estimation) oo_.gui.ran_estimation = true; +if isoctave && isfield(options_, 'prior_restrictions') && ... + isfield(options_.prior_restrictions, 'routine') + % Octave crashes if it tries to save function handles (to the _results.mat file) + % See https://savannah.gnu.org/bugs/?43215 + options_.prior_restrictions.routine = []; +end