title: draw ellipse and ellipsoid in MATLAB
body: <p>How do I draw an ellipse and an ellipsoid using MATLAB?</p>
  
  <p><code>(x^2/a^2)+(y^2/b^2)=1</code></p>
  
  <pre><code>n=40;
  a=0;   b=2*pi;
  c=0;   d=2*pi;
  for i=1:n
      u=a+(b-a)*(i-1)/(n-1);
      for j=1:m
          v=a+(d-c)*(j-1)/(m-1);
          x(i,j)=sin(u)*cos(v);
          y(i,j)=sin(u)*sin(v);
          z(i,j)=cos(u);
      end
  end
  mesh(x,y,z);
  </code></pre>
  
  <p>But I want the shape?</p>