economics problem using matlab

#1
I tried to solve this problem using matlab. but I don't know What I solve this problem. please help me.

% iterate.m
% Simple example of value function iteration
clear all
% Parameter values
beta=0.985;
A=0.2;
alpha=0.3;
delta=0.10;
% Technical parameters
incr=0.01; % Increment in the capital grid
maxk=12; % Maximum value for capital
maxcrit=10 ^(-5); % Converge criterion
% Setting up the capital grid
kgrid=[incr:incr:maxk];
n=length(kgrid);
% Possible consumption values depending on k and k’; this is an n-by-n matrix
% Each column is different k, each row is different k’
cons=ones(n,1)*((1-delta)*kgrid+A*kgrid.^alpha)-kgrid'*ones(1,n);
% Throwing out negative values and taking logs to get period utilities
util=log(max(cons,0.00001*ones(n,n)));
% The initial guess for the value function
v=zeros(1,n);
% crit is the test function
crit=1;
while crit>maxcrit;
% The actual maximization step; g stores the optimizing index
[vnew g]=max(util+beta*v'*ones(1,n));
crit=max(abs(v-vnew));
v=vnew;
end
% Plotting Figures
figure;
pl=plot(kgrid,v);
hold on
set(pl,'LineWidth',2);
xlabel('Capital');
ylabel('Utility');
title('Value Function');
hold off
figure;
plot(kgrid,[kgrid; incr*g]);
hold on
set(pl,'LineWidth',2);
xlabel('Capital Today');
ylabel('Capital Tomorrow');
title('Policy Function');
hold off
 
Last edited: