title: Downsampling, or equalizing vector lengths in matlab
body: <p>I'm having somewhat of a basic problem yet I can't seem to solve it. I have two very large pieces of data. I have a matrix A that is 48554 x 1 and and a matrix B that is 160272 x 1. What I want to do is "downsample" matrix B so that it is of the same length as matrix A. Moreover, I want a function that can do this for pretty much any large m x 1 and n x 1 matrices (so that it works for more than this specific example). I tried using the resample function like so:</p>
  
  <pre><code>resample(B,length(A),length(B))
  </code></pre>
  
  <p>However I'm getting an error indicating that the filter length is too large. Next I tried using a for loop to simply extract every ith element from matrix B and save it into a new matrix, but this was not working out so nicely since the vector lengths aren't divisible by an integer. Does anyone have other (hopefully simple) ways to accomplish this?</p>