Displaying and plotting exogenous variables

Hi I have a very simple question. I am new to Dynare and replicating the example given in practicing Dynare (Barillas et. al) showing the impact of an increase in government spending (Chapter 11 RMT). I basically tried to run the code that was given in Sargent’s website and could not get it to run. I have finally managed to get it to work but cannot dislay or extract the exogenous variable g. The example keeps referring to g as ex_(:,1), but Dynare does not allow me to display it. The code is given below,
Could you please help me with displaying the exogenous shock g. I tried rplot ex_(:,4) as it is the fourth exogenous variable.

Thanks

// This program replicates figure 11.3.1 from chapter 11 of RMT2 by Ljungqvist and Sargent.
var c k;
varexo taui tauc tauk g;
parameters bet gam del alpha A;
bet=.95;
gam=2;
del=.2;
alpha=.33;
A=1;

model;
k=Ak(-1)^alpha+(1-del)k(-1)-c-g;
c^(-gam)= bet
(c(+1)^(-gam))
((1+tauc(-1))/(1+tauc))((1-taui)(1-del)/(1-taui(-1))+
((1-tauk)/(1-taui(-1)))alphaA*k(-1)^(alpha-1));
end;

initval;
k=1.5;
c=0.6;
g = 0.2;
tauc = 0;
taui = 0;
tauk = 0;
end;
steady;

endval;
k=1.5;
c=0.4;
g =.4;
tauc =0;
taui =0;
tauk =0;
end;
steady;

shocks;
var g;
periods 1:9;
values 0.2;
end;

simul(periods=100);

co=ys0_(var_index(‘c’));
ko = ys0_(var_index(‘k’));
go = ex_(1,1);

rbig0=1/bet;
rbig=y_(var_index(‘c’),2:101).^(-gam)./(bety_(var_index(‘c’),3:102).^(-gam));
rq0=alpha
Ako^(alpha-1);
rq=alpha
Ay_(var_index(‘k’),1:100).^(alpha-1);
wq0=A
ko^alpha-koalphaAko^(alpha-1);
wq=A
y_(var_index(‘k’),1:100).^alpha-y_(var_index(‘k’),1:100).alphaA.y_(var_index(‘k’),1:100).^(alpha-1);
sq0=(1-ex_(1,4))Aalpha
ko^(alpha-1)+(1-del);
sq=(1-ex_(1:100,4)’)Aalpha.*y_(var_index(‘k’),1:100).^(alpha-1)+(1-del);

rplot c;
rplot plot ex_(:,4) ;

The “ex_” variable does not exist in Dynare 4. Your example is clearly outdated, and corresponds to an old version of Dynare. Please refer to the documentation of Dynare 4 for achieving this. Essentially, in Dynare 4, the steady state is in “oo_.steady_state”, the path of endogenous variables is in “oo_.endo_simul”, and the path of exogenous variables in “oo_.exo_simul”.