title: Matlab plot won't return correct results
body: <p>I have written a function that is the beginning of a Poisson Process</p>
  
  <pre><code>function n_t = PoisProc2(t,tao,SIZE)
  
  n_t=0;
  
  for n=1:SIZE
  
      if t&gt;tao(1,n)
          n_t=n_t+1;
      end
  
  end
  
  
  end
  </code></pre>
  
  <p>tao is simply an array of random doubles of length SIZE. For simplicity we'll say [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,20]</p>
  
  <p>So this functions purpose is to count how many elements of tao that t is greater than for any given t.</p>
  
  <p>This code works fine when I simply write</p>
  
  <pre><code>PoisProc2(3,tao,20);
  </code></pre>
  
  <p>the answer I get is 19 as expected, but if I write</p>
  
  <pre><code>x=1:.01:20;
  y=PoisProc2(x,tao,20);
  plot(x,y,'-')
  </code></pre>
  
  <p>y shows up as 0 in the workspace (I would expect an array of length 1901) and my plot also reads 0. I'm pretty new to Matlab, but this seems like a pretty simply thing I'm trying to do and I must be missing something obvious. Please help!</p>