I run the following file:
load('NDF_results.mat', 'oo_');
irf1=oo_.irfs;
save irf1;
load irf1;
load('NDF2_results.mat', 'oo_');
irf2=oo_.irfs;
save irf2;
load irf2;
ending_cell={'_epsyoil'};
for ii=1:length(ending_cell)
HOR=1:1:100;
var={'Y','L'};
figure
for jj=1:length(var)
subplot(1,2,jj)
eval(['irf1.' var{1,jj},ending_cell{1,ii}]);
eval(['irf2.' var{1,jj},ending_cell{1,ii}]);
hold on
plot(HOR,[eval(['irf1.' var{1,jj},ending_cell{1,ii}])],'LineWidth',1,'-k',HOR,[eval(['irf2.' var{1,jj},ending_cell{1,ii}])],'LineWidth',1,'--r')
title([var{1,jj}] )
end
end
But I get the following error:
Error using plot
Data must be a single matrix Y or a list of pairs X,Y.
Error in mohsen (line 24)
plot(HOR,[eval([‘irf1.’ var{1,jj},ending_cell{1,ii}])],‘LineWidth’,1,’-k’,HOR,[eval([‘irf2.’
var{1,jj},ending_cell{1,ii}])],‘LineWidth’,1,’–r’)