title: Matlab resample time series for specific times, rather than frequencies
body: <p>I have the following problem in Matlab:</p>
  <p>I have a time series which looks like this:</p>
  <pre><code>size(ts) = (n,2); % with n being the number of samples, the first column is the time, the second the value.
  </code></pre>
  <p>Let's say I have:</p>
  <pre><code>ts(:,1) = [0, 10, 20, 30, 40];
  ts(:,2) = [1,  3, 10,  6, 11];
  </code></pre>
  <p>I would like to resample the signal above to get the interpolated values at different times. Say:</p>
  <pre><code>ts(:,1) = [0,  1,  3, 15, 40];
  ts(:,2) = ???
  </code></pre>
  <p>I had a look at the Matlab functions for signal processing but they are all only relevant for regular sampling at various frequencies.</p>
  <p>Is there a built in function which would give me the above, or do I have to compute the linear interpolation for each new desired time manually? If so, do you have a recommendation to do this efficiently using vecotrized code (just started Matlab a month ago so still 100% at ease with this and relying on for loops a lot still).</p>
  <p>For a bit of context, I'm using a finite difference scheme in series to investigate a problem. The output of one FD scheme is fed into the following. Due to the nature of my problem, I have to change the time stepping from one FD to the next, and my time steps can be irregular.</p>
  <p>Thanks.</p>