remove unnecessary eval statements

time-shift
Houtan Bastani 2019-09-11 10:11:36 +02:00
parent c5ac16bb99
commit f118970736
No known key found for this signature in database
GPG Key ID: 000094FB955BE169
2 changed files with 3 additions and 8 deletions

View File

@ -239,9 +239,7 @@ while fpar<B
stock_irf_bvardsge(:,:,:,IRUN) = reshape(tmp_dsgevar,options_.irf,dataset_.vobs,M_.exo_nbr);
else
stock_irf_bvardsge(:,:,:,IRUN) = reshape(tmp_dsgevar,options_.irf,dataset_.vobs,M_.exo_nbr);
instr = [MhDirectoryName '/' M_.fname '_irf_bvardsge' ...
int2str(NumberOfIRFfiles_dsgevar) '.mat stock_irf_bvardsge;'];
eval(['save ' instr]);
save([MhDirectoryName '/' M_.fname '_irf_bvardsge' int2str(NumberOfIRFfiles_dsgevar) '.mat'], 'stock_irf_bvardsge');
if RemoteFlag==1
OutputFileName_bvardsge = [OutputFileName_bvardsge; {[MhDirectoryName filesep], [M_.fname '_irf_bvardsge' int2str(NumberOfIRFfiles_dsgevar) '.mat']}];
end
@ -255,9 +253,7 @@ while fpar<B
stock_irf_dsge = stock_irf_dsge(:,:,:,1:irun);
if MAX_nirfs_dsgevar && (fpar == B || IRUN == B)
stock_irf_bvardsge = stock_irf_bvardsge(:,:,:,1:IRUN);
instr = [MhDirectoryName '/' M_.fname '_irf_bvardsge' ...
int2str(NumberOfIRFfiles_dsgevar) '.mat stock_irf_bvardsge;'];
eval(['save ' instr]);
save([MhDirectoryName '/' M_.fname '_irf_bvardsge' int2str(NumberOfIRFfiles_dsgevar) '.mat'], 'stock_irf_bvardsge');
NumberOfIRFfiles_dsgevar = NumberOfIRFfiles_dsgevar+1;
if RemoteFlag==1
OutputFileName_bvardsge = [OutputFileName_bvardsge; {[MhDirectoryName filesep], [M_.fname '_irf_bvardsge' int2str(NumberOfIRFfiles_dsgevar) '.mat']}];

View File

@ -248,8 +248,7 @@ if options_.irf
for j = 1:nvar
assignin('base',[M_.endo_names{i_var(j)} '_' M_.exo_names{i}],...
y(i_var(j),:)');
eval(['oo_.irfs.' M_.endo_names{i_var(j)} '_' ...
M_.exo_names{i} ' = y(i_var(j),:);']);
oo_.irfs.([M_.endo_names{i_var(j)} '_' M_.exo_names{i}]) = y(i_var(j),:);
if max(abs(y(i_var(j),:))) >= options_.impulse_responses.plot_threshold
irfs = cat(1,irfs,y(i_var(j),:));
if isempty(mylist)