Replace name in the graphic

3 ビュー (過去 30 日間)
Touré Mohamed
Touré Mohamed 2021 年 3 月 28 日
コメント済み: Touré Mohamed 2021 年 3 月 28 日
Hi Everyone!
I would like to replace the names for this graphic with another name. For example, replace rdp with GDP, tx_inf with TAX.... I thank you very much for your help.
My code is:
dynare thesimy.mod;
irf1 = oo_.irfs;
save thesimy.mat irf1;
dynare thesimy2.mod;
irf2 = oo_.irfs;
save thesimy2.mat irf2;
load('thesimy.mat','irf1');
load('thesimy2.mat','irf2');
ending_cell={'_eps_a','_eps_r','_eps_g','_eps_tau'};
%'rdp', 'tx_infl', 't_cres', 'tax_jrn', 'h_prod'
for ii=1:length(ending_cell)
HOR=1:options_.irf;
var={'rdp', 'tx_infl', 't_cres', 'tax_jrn', 'h_prod'};
figure
for jj=1:length(var)
subplot(3,3,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}])],'-k',HOR,[eval(['irf2.' var{1,jj},ending_cell{1,ii}])],'--r','LineWidth',2);
title([var{1,jj}] )
end
legend('thesimy', 'thesimy2', 'AutoUpdate','off')
end
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 3 月 28 日
dynare appears to refer to https://www.dynare.org/

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2021 年 3 月 28 日
Currently, the values in var={'rdp', 'tx_infl', 't_cres', 'tax_jrn', 'h_prod'}; are used as the titles, and also as the field names of variables to retrieve. So you should
var={'rdp', 'tx_infl', 't_cres', 'tax_jrn', 'h_prod'};
var_titles = {'GDP', 'TAX', 'Crespiatica', 'Jargonize', 'Productida'};
and change
title([var{1,jj}] )
to
title([var_titles{1,jj}] )
  1 件のコメント
Touré Mohamed
Touré Mohamed 2021 年 3 月 28 日
Thank you very much, Walter. Your answer was helpful.

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by