Hi all,

I´m trying to recover the impulse response values after estimation, ie, basically put the values together in a matrix . For this purpose, supose I have two shocks, I´m trying to loop over the shocks for some endogenous variable. The next step would be to put the values for the two shocks in a matrix. This is where I´m failing.

The shocks are “ah” and “yh”. This is the loop I´m trying to do:
str = ‘ah’ ,‘ys’]
for i = 1:length(str);
resultado = [oo_PosteriorIRF.dsge.Mean.y_hat_eps_choque]

% in this last step is where I was planning to put the response of y_hat to the two shocks

Do you have any suggestion for achiving my goal? Sorry if this is a silly or basic question

Thanks in advance.

Working with strings is correct, but you need to use the eval-command. See e.g. [Q: combining IRFs into subplotted figures & iterating?)