Skip to content
Snippets Groups Projects
Commit 76a2aaff authored by Marco Ratto's avatar Marco Ratto
Browse files

rename local variables to minimize the risk of overlapping with names stored in data file

(cherry picked from commit 3aa94198)
parent c8ff6416
Branches
No related tags found
1 merge request!3724.3; bug fixes for GSA tools
function c = dat_fil_(data_file);
function list_of_exported_variables_ = dat_fil_(dat_fil_to_load_);
% Written by Marco Ratto
% Joint Research Centre, The European Commission,
% (http://eemc.jrc.ec.europa.eu/),
......@@ -25,14 +25,14 @@ function c = dat_fil_(data_file);
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
try
eval(data_file);
eval(dat_fil_to_load_);
catch
load(data_file);
load(dat_fil_to_load_);
end
clear data_file;
clear dat_fil_to_load_;
a=who;
list_of_local_variables_=who;
for j=1:length(a)
eval(['c.',a{j},'=',a{j},';']);
for j=1:length(list_of_local_variables_),
eval(['list_of_exported_variables_.',list_of_local_variables_{j},'=',list_of_local_variables_{j},';']);
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment