% Create a contour of population lst sq
load 'uspop';
p0 = linspace(5,25,100);
r  = linspace(0.01,0.02,100);
[X,Y] = meshgrid(p0,r);
Z = zeros(100);
for i=1:100
    for j=1:100
        Z(j,i) = mallstsqc(p0(i),r(j),t,pop);
    end
end

figure(1)
contourf(X,Y,log(Z),20)
xlabel('$P_0$','interpreter','latex')
ylabel('$r$','interpreter','latex')