%%% Main Program %%% Grid size N = 100; %%% Wage grid w = linspace(0,1,N)' ; %%% Probability distribution p = 1/N*ones(1,N) ; beta = [0.1 0.5 0.9] ; c = [0 0.1 0.5] ; Vbeta = zeros(N,3) ; Vc = zeros(N,3) ; for i = 1:3 Vbeta(:,i) = valit(beta(i),0,w,p) ; Vc(:,i) = valit(.1,c(i),w,p) ; end ; figure(1) ; subplot(2,1,1) ; plot(w,Vbeta(:,1),'k-',w,Vbeta(:,2),'k--',w,Vbeta(:,3),'k-.') ; xlabel('Wage','Fontsize',14) ; ylabel('Value function','Fontsize',14) ; grid on ; title('Varying \beta, c=0','Fontsize',14) ; leg{1} = ['\beta = ',num2str(beta(1))] ; leg{2} = ['\beta = ',num2str(beta(2))]; leg{3} = ['\beta = ',num2str(beta(3))] ; legend(leg) ; subplot(2,1,2) ; plot(w,Vc(:,1),'k-',w,Vc(:,2),'k--',w,Vc(:,3),'k-.') ; xlabel('Wage','Fontsize',14) ; ylabel('Value function','Fontsize',14) ; grid on ; title('Varying c, \beta=0.1','Fontsize',14) ; leg{1} = ['c = ',num2str(c(1))] ; leg{2} = ['c = ',num2str(c(2))] ; leg{3} = ['c = ',num2str(c(3))] ; legend(leg) ;