clc
clear all
close all

X = -3:.1:3;
Y = X;
[x, y] = meshgrid(X, Y);
z = 6 - x.^2 - y.^2;
figure
contour(x, y, z);

% or (with the level)
figure
[c] = contour(x, y, z);
clabel(c);

% or (with an anonymous function)
f = @(x, y) 6 - x.^2 - y.^2;
figure
fcontour(f, [-10 10 -10 10])

% or (with anonymous function an level)
figure
h = fcontour(f, [-10 10 -10 10])
h.LevelList = -10:2:10;
colorbar
