title: How to plot a sphere function?
body: <p>I tried plotting a sphere <a href="http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO_files/Page1113.htm" rel="nofollow noreferrer">to look like this</a>. </p>
  
  <p><a href="https://stackoverflow.com/questions/16760976/input-error-in-contour-plot-of-a-sphere-function-in-matlab">This earlier question</a> contains the code where i tried plotting.  </p>
  
  <p>That previous question was answered, but now I am having trouble plotting the sphere function as shown in the plot given by the link above.</p>
  
  <p><strong>Edit</strong>
  This is the sphere function i am using:</p>
  
  <pre><code>function ph = sphereFN(x)
      ph = sum(x.*x, 2);
  
  end
  </code></pre>
  
  <p><strong>Edit</strong>
  Outcome should look something like this:
  <img src="https://i.stack.imgur.com/VkGhG.jpg" alt="enter image description here"></p>
  
  <p>NB: I have changed the function from sphere to sphereFN to avoid the conflict with the matlab sphere.</p>