clear all; close all; alpha = 0.35; delta = 0.06; sigma = 0.20; kstar = (sigma/delta)^(1/(1-alpha)); k(1) = 0.5*kstar; for t = 1:50 y(t) = k(t)^alpha; i(t) = sigma*y(t); c(t) = y(t)-i(t); k(t+1) = (1-delta)*k(t)+i(t); if t >= 2 g(t-1) = y(t)/y(t-1)-1; end end gc = c(2:end)./c(1:end-1) - 1; gi = i(2:end)./i(1:end-1) - 1; figure plot(1:50,c,1:50,i) legend('c','i') figure plotyy(1:50,y,1:49,g) legend('y','g') figure plot(1:49,gc,1:49,gi) legend('gc','gi')