When you pass a scalar positive integer value in as the fourth input to contour it is treated as the number of contour levels contour should choose and display, not as the contour levels themselves. To specify you want a single contour at a specific level, pass a two-element vector with the same value in each element as that input.
contour(x1,x2,cost,[1 1],'g','LineWidth',1)
But if I look at the minimum value of the z matrix you created, it is 1.75. That means there should not be a region in the contour plot for that set of data at level z = 1. So you're not going to be able to create the second figure you showed: there are only two circular regions, not three.
>> min(z, [], 'all')
ans =
1.75