title: Matlab don't show negative values
body: <p>I am making a matlab file to analyse the performance of an aircraft. What I want to do is see where the excess power is max and where the excess power becomes minimum. I was able to make that matlab doesn't take into consideration values more than the Clmax (by using <code>NaN</code>).<br>
  Now I want to do the same for the excess power: I don't want my contour plot to display the negative values of PS. I tried doing the same as I did with the Cl, but without success. </p>
  
  <p>This the code so far:  </p>
  
  <pre><code>TA= 667233.2;
  W=228000;
  S=360;
  CDO=0,02;
  b=60;
  AR=10;
  h=0;
  
  
  v= [60:10:350]
  hoogte= [0:1000:17000]
  
  %TEST
  
  for j=1:length(hoogte)
  hoogte_temp = hoogte(j)
  [rho c] = Atmos(hoogte_temp)
  sigma= rho/1.225
  
  for i= 1:length(v)
      v_temp = v(i);
      q= rho*v_temp*v_temp/2
      cl(i,j) = W*9.81/S/q
  
    if (cl&lt;1.91)
     cd(i,j) = 0.02 + cl(i,j)^2/(AR*3.14*0.8)/beta(i)
      D(i,j)= cd(i,j)*q*S
      PS(i,j)=(TA*sigma-D(i,j))*v_temp/(W*9.81)
  
  
    else %als Cl groter is dan 1,91: niet weergeven, ook niet Cd, D en ook niet Ps
      cl(cl&gt;1.91) = NaN;
      cd(i,j)= NaN;
      D(i,j)=NaN;
      PS(i,j)=NaN;
    end
  
      if(v_temp/c&lt;1)
          beta(i)=sqrt(1-(v_temp/c)^2)
  
      else
          beta(i) = NaN
      end
  
      cd(i,j) = 0.02 + cl(i,j)^2/(AR*3.14*0.8)/beta(i)
      D(i,j)= cd(i,j)*q*S
      PS(i,j)=(TA*sigma-D(i,j))*v_temp/(W*9.81)
  
  end
  </code></pre>
  
  <p>I thought of just adding another <code>if (PS&lt;0)</code> or even <code>if PS&lt;=D 
  PS=NaN</code>, but that does not seem to be working if I rerun the program and look at the graph.</p>
  
  <p>The <code>atmos.m</code> file is a file I made where the atmosphere and its properties (like temperature, altitude and density) vary.<br>
  What I want to do now:<br>
  Cancel the negative PS values, and find the sigma and v_temp values for which PS becomes <code>0</code>. This would lead me then to the max cruising altitude.  </p>
  
  <p>I'm new to matlab, and everything in this code was done by looking up on the internet and looking youtube movies. Any feedback will greatly be appreciated! I found this:  </p>
  
  <pre><code>    data( indices_to_data_not_to_plot )  = NaN;
      surf(x,y,data);  %# or whatever you're using
  </code></pre>
  
  <p>in another topic, but it's the thing I tried I guess, which does not work, except I use contour instead of surf.</p>