title: Matlab Function Representation
body: <p>I understand that if I wanted to generate y values of y=sin(2x) I could do: </p>
  
  <pre><code>y = sin(0:.01:2*2); 
  </code></pre>
  
  <p>However, if I wanted to generate values for where y = 0 unless x is a multiple of 1 or sqrt(2) at which points y=1, how would I approach that problem? Must I create a window around the values and hope the step size is small enough to capture it? Thank you. </p>