function prohluben_kopec
x=-10:5:10;
y=x;
[X,Y]=meshgrid(x,y);
Z=X.^2+0.5.*Y.^2;
subplot(2,2,1)
mesh(X,Y,Z)
subplot(2,2,3)
contour(X,Y,Z)
hold on
[F,G]=gradient(Z);
quiver(x,y,F,G);
hold off
subplot(2,2,2)
mesh(X,Y,-Z)
subplot(2,2,4)
contour(X,Y,-Z)
hold on
[F,G]=gradient(-Z);
quiver(x,y,F,G);
hold off
end

