x = linspace(-1,1,50); y = x; [X, Y] = meshgrid(x,y); Z = hemisphere(X,Y,1); surf(X,Y,Z);