f = @(x1,x2) (x1+2).^2 - x2;
g1 = @(x1,x2) x1.^2/4 + x2 -1; 
g2 = @(x1,x2) 2 + x1 - 2*x2;

% plot constraints lines
fimplicit(g1,'LineWidth',1)
hold on
fimplicit(g2,'LineWidth',1)
axis([-3 1 -2 2]); grid

% plot contour of f
la = -1:-0.1:-2.0;
lb = [-0.2005, -0.5, -0.8];
fcontour(f, 'LevelList', [la, lb], 'LineColor','blue','LineWidth',1)
legend('g1 constraint', 'g2 constrain', 'f contour', 'Location','southeast');
hold off
