title: Matlab Sphere plot without using the Sphere Function
body: <p>I am trying to draw a sphere in Matlab without using the Sphere Function. This is my code: </p>
  
  <pre><code>r = 2;
  [ x,y ] = meshgrid(-4:0.1:4);
  z = sqrt(r^2-x.^2-y.^2);
  mesh(real(z));
  hold on 
  mesh(real(-z));
  </code></pre>
  
  <p>The code above does generate a sphere of equation r^2=x^2+y^2+z^2. The only problem is that there is a horizontal plane slicing the sphere. </p>
  
  <p>My question is how can I plot a sphere that doesn't show the horizontal plane?</p>
  
  <p>The reason I am not using a Sphere function is because I want to plot a surface equation. If I use the Sphere function then Matlab assumes my surface will be a sphere.</p>