From fd968492289e97f1a08f91606a8eeaa657b35c9a Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Thu, 5 Mar 2020 11:41:18 +0100
Subject: [PATCH] if user does not want to use previous dynare run, remove
 variables from base workspace

---
 src/dynare_gui.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dynare_gui.m b/src/dynare_gui.m
index 622da14..8c40b35 100644
--- a/src/dynare_gui.m
+++ b/src/dynare_gui.m
@@ -125,7 +125,7 @@ if (exist('M_', 'var') && isstruct(M_)) || (exist('oo_', 'var') && isstruct(oo_)
         'It seems like you have already run dynare. Do you want to use the output in the workspace?', ...
         'DynareGUI', 'Yes', 'No', 'Yes');
     if strcmp(answer, 'No')
-        evalin('global', 'clear M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_');
+        evalin('base', 'clear M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_');
     else
         if ~(exist([M_.fname filesep 'model' filesep 'json' filesep 'modfile-original.json'], 'file') == 2 ...
                 && exist([M_.fname filesep 'model' filesep 'json' filesep 'modfile.json'], 'file') == 2)
-- 
GitLab