title: How can I get a sound to be presented through MATLAB for an exact duration?
body: <p>I am new to sound processing and I am trying to present a tone of 0.2ms, 0.3ms and 0.4ms to a user.</p>
  
  <p>The code that I did is as follows: (MATLAB)</p>
  
  <pre><code>Fs = 16000;
  duration = 0.2;
  level = 0;
  freq1 = 500;
  t = 0: 1/Fs : duration*(Fs-1)/Fs;
  fa1 = 10^(level/20);
  y1 = fa1*sin(2*pi*freq1*t)';
  ap = audioplayer(y1,Fs);
  tic
  playblocking(ap)
  toc
  </code></pre>
  
  <p>The time I obtained from the tic,toc functions is 0.56 for a 0.2s duration I specified.</p>
  
  <p>Is there anyway to make it present for exactly 0.2s?</p>