

N=101;
a=-1;b=1;
c=-1;d=1;
x=linspace(a,b,N);
y=linspace(c,d,N);

figure;

for i=1:N;
for j=1:N;

z(i,j)=sqrt(x(j)*x(j)+y(i)*y(i));
end;
end;
surf(x,y,z)
box on;
xlabel('x'); ylabel('y');zlabel('z');
title('Cone: $z=\sqrt{x^2+y^2}$','Interpreter','latex');
view([1 1 1])
 
figure;
contour(x,y,z,20)
axis([a b c d]);
axis square;
title('Level curves of a cone: $z=\sqrt{x^2+y^2}$','Interpreter','latex');

