%% use MATLAB set variables
global vlast beta delta theta k0 kt
hold off
hold on
%% set initial conditions
vlast=zeros(1,100)
k0=0.06:0.06:6
beta=0.98
delta=0.1
theta=0.36
numits=240
%% begin the recursive calculations
for k=1:numits
for j=1:100
kt=j*0.06
% find the maximum of value function
ktp1=fminbnd(@valfun,0.01,6.2)
v(j)=-valfun(ktp1)
kt1(j)=ktp1
end
if k/48==round(k/48)
% plot the steps in finding the value function
plot(k0,v)
drawnow
end
hold off
% plot the final policy function
plot(k0,kt1)
怎么将bellman方程写入? v(kt)=ln(kt-k(t+1)+(1-delta)kt)+beta*v(k(t+1))_