title: How to use resample function in matlab on a set of data
body: <p>I am a beginner in MATLAB. I have a question on how to use the <a href="http://www.mathworks.com/help/signal/ref/resample.html" rel="nofollow"><code>resample</code></a> function in matlab. I want to reduce the size of my data from 1881456 counts to half of it. My sample frequency is 128 Hz. However, the example shown in MATLAB documentation is quite confusing to me . </p>
  
  <p>The function that I want to use is this :</p>
  
  <pre><code>y = resample(x,p,q)
  </code></pre>
  
  <p>The example given is like below:</p>
  
  <pre><code>fs1 = 10;
  t1 = 0:1/fs1:1;
  x = t1;
  y = resample(x,3,2);
  t2 = (0:(length(y)-1))*2/(3*fs1);
  figure, clf
  plot(t1,x,'*',t2,y,'o',-0.5:0.01:1.5,-0.5:0.01:1.5,':')
  </code></pre>
  
  <p>As stated above, the set of data is generated in the codes above by inserting the resampled data <code>y</code> into the <code>t2</code> equation whereas mine is already generated by the inertial sensor. </p>
  
  <p>I need some advice and guide on how to use this simple "resample" function in MATLAB to resample my already generated sensor data.</p>