function sedloFunNovo(a, b )
%sedlo x^2 - y^2 na območju a x b
if (nargin() == 1)
a = -abs(a);
b = -a; % [-|a|, |a|]
end
if (nargin() == 0)
a = -2;
b = 2; %
end
x = linspace(a, b, 100);
y = x;
[xi,yi] = meshgrid(x,y);
zi = yi.^2 - xi.^2;
surfc(xi,yi,zi)
colormap copper % barvna shema
shading interp % senčenje
view([25,15,20]) % točka gledišča
grid off
|
title('Hiperbolični paraboloid z = y^2 – x^2')
h = get(gca,'Title');
set(h,'FontSize',12)
xlabel('x')
h = get(gca,'xlabel');
set(h,'FontSize',12)
ylabel('y')
h = get(gca,'ylabel');
set(h,'FontSize',12)
zlabel('z')
h = get(gca,'zlabel');
set(h,'FontSize',12)
pause(5)
figure
contourf(zi), hold on, shading flat
[c,h] = contour(zi,'k-'); clabel(c,h)
title('Nivojske krivulje z = y^2 - x^2.')
h = get(gca,'Title');
set(h,'FontSize',12)
xlabel('x')
h = get(gca,'xlabel');
set(h,'FontSize',12)
ylabel('y')
h = get(gca,'ylabel');
set(h,'FontSize',12)
end
|