title: error in displaying a 3-D Plot in matlab
body: <p>I wanted to draw the following function in matlab:<br>
     <code>f(x,y)  = sqrt(1-x^2-4y^2)    ,(if  (x^2+4*y^2) &lt;=1 )</code></p>
  
  <pre><code>        =  0                  ,otherwise.
  </code></pre>
  
  <p>I wrote the following code in matlab:   </p>
  
  <pre><code>  x=0:0.1:10;  
    y=0:0.1:10;
    z=x.^2+4*y.^2;
    if (z &lt;=1)
     surf(x,y,z);
  
    else
     surf(x,y,0);
    end
  </code></pre>
  
  <p>but the following error is displayed:<br>
        <code>surface: rows (Z) must be the same as length (Y) and columns (Z) must be the same as length (X)</code><br>
  How shall I avoid this error...</p>