v = linspace(-0.5,1,10);
[x,y] = meshgrid(v);
z = x.^2 - y.^2;				% funkèní hodnoty
subplot(1,2,1);				% graf gunkce
  surf(x,y,z ,'FaceAlpha',0.5);
  axis square
subplot(1,2,2);		
  [px,py] = gradient(z);		 
  contour(v,v,z,'k');hold on;	% vrstevnice  
  quiver(v,v,px,py,'k');hold off;	% gradient v bodech
axis square











