From 76a2aaffe641f7f91ec6c628cad8c50eab6ea076 Mon Sep 17 00:00:00 2001 From: Marco Ratto <marco.ratto@jrc.ec.europa.eu> Date: Thu, 18 Apr 2013 19:35:49 +0200 Subject: [PATCH] rename local variables to minimize the risk of overlapping with names stored in data file (cherry picked from commit 3aa94198356b6112d9bcfb5617b090d7309c737b) --- matlab/gsa/dat_fil_.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/matlab/gsa/dat_fil_.m b/matlab/gsa/dat_fil_.m index aeffd40d2c..397e22a5e5 100644 --- a/matlab/gsa/dat_fil_.m +++ b/matlab/gsa/dat_fil_.m @@ -1,4 +1,4 @@ -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 -- GitLab