title: Obtaining NaN for the CDF values of a normally distributed variable: Matlab
body: <p>I can't seem to understand why my simple code given below doesn't work. I get <code>NaN</code> for the <code>P_j</code> values.</p>
  
  <pre><code>% Plotting the CDF for normally distributed variable
  mu_j = 0.008;
  simga_j = -0.002;
  x= 0.008 -0.002*randn(100000,1);
  X_j = min(x) : (max(x) - min(x))/100000 : max(x);
  P_j = normcdf(X_j,0.008,-0.002); 
  
  figure(1)
  
  plot(X_j,P_j);
  </code></pre>
  
  <p>Thanks</p>