Skip to content
Snippets Groups Projects
Commit 4537f466 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

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.
parent 294cf81d
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment