From 0038bbe755ed8b7d450d18331fdb29aadcf0bd64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Thu, 12 Nov 2015 14:38:16 +0100 Subject: [PATCH] Closes #1057. Use a static file with a list of routines to cleared before each run (because they have persistent variables).This static file (the script matlab/list_of_functions_to_be_cleared.m) is distributed with Dynare and needs to be updated for each release (or each time we add/remove persistent variables). To update the file just do: >> clear_persistent_variables(DYNARE_MATLAB_PATH, true) and add/commit the generated file. --- ModFile.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModFile.cc b/ModFile.cc index abf093e1..d3748dca 100644 --- a/ModFile.cc +++ b/ModFile.cc @@ -579,7 +579,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo << " clear all" << endl << "else" << endl << " clearvars -global" << endl - << " clear_persistent_variables(fileparts(which('dynare')))" << endl + << " clear_persistent_variables(fileparts(which('dynare')), false)" << endl << "end" << endl; else if (clear_global) mOutputFile << "clear M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_;" << endl;