Removed clear all for Matlab>=R2015b.

By default, Dynare clears the globals and functions containing
persistent variables. The behaviour of Dynare is not changed with
Matlab<R2015b or Octave.
issue#70
Stéphane Adjemian (Charybdis) 2015-09-30 22:52:48 +02:00
parent 294cf81d8b
commit 4537f46647
1 changed files with 6 additions and 1 deletions

View File

@ -575,7 +575,12 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
mOutputFile << "warning off" << endl; // This will be executed *after* function warning_config()
if (clear_all)
mOutputFile << "clear all" << endl;
mOutputFile << "if isoctave || matlab_ver_less_than('8.6')" << endl
<< " clear all" << endl
<< "else" << endl
<< " clearvars -global" << endl
<< " clear_persistent_variables(fileparts(which('dynare')))" << endl
<< "end" << endl;
else if (clear_global)
mOutputFile << "clear M_ options_ oo_ estim_params_ bayestopt_ dataset_;" << endl;