title: How to plot a parametric surface in Matlab
body: <p>I have a parametric B-Spline surface, <code>S</code></p>
  
  <pre><code>S=[x(:);y(:);z(:)];
  </code></pre>
  
  <p>Right now, I am plotting the surface by just plotting each column of <code>S</code> as a single point:</p>
  
  <pre><code>plot3(S(1,:),S(2,:),S(3,:),'.')
  </code></pre>
  
  <p>The result is this:</p>
  
  <p><a href="https://i.stack.imgur.com/0a7zg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0a7zg.png" alt="S plotted as a collection of points"></a></p>
  
  <p>Unfortunately, by plotting individual points, we lose the sense of depth and curvy-ness when we look at this picture.</p>
  
  <p>Any ideas on how to implement <code>SURF</code> or <code>MESH</code> command for a parametric surface? These functions seem to require a matrix representing a <code>meshgrid</code> which I dont think I can use since the X x Y domain of <code>S</code> is not a quadrilateral. However, I like the lighting and color interpolation that can be conveniently included when using these functions, as this would fix the visualization problem shown in figure above.</p>
  
  <p>I am open to any other suggestions as well.</p>
  
  <p>Thanks.</p>