d = 0.1;

[X,Y] = meshgrid(-2:d:2);
Z = (-X.^2 + Y.^2);
[C,h]=contour(X,Y,Z,10)
clabel(C,h)

[U,V] = gradient(Z,d,d);
hold on
quiver(X,Y,U,V)
hold off 

colorbar
axis square

figure 
surfc(X,Y,Z)
%contour3(X,Y,Z,10)

figure 
quiver(X,Y,-Y,X)
xlim([-2 2]);ylim([-2 2]);
axis square

Z = sqrt(X.^2+Y.^2)
hold on 
contour(X,Y,Z)

figure
phi = 0:pi/50:2*pi;
arr = cos(phi) + sin(phi);
 [U,V]=pol2cart(phi, arr)
 quiver(X,Y,cos(atan(Y./X)),sin(atan(Y  ./X)))