title: MATLAB weighted resampling
body: <p>I'm writing a particle filter localization algorithm as part of an exercise to locate a plane flying over mountains.</p>
  
  <p>From my understanding, the steps to this are:
  - make a bunch of random guesses
  - filter out unlikely guesses (using Gaussian hypothesis testing and some known information about the problem)
  - shift filtered points by how much the plane moved in that step
  - resample, weighted by shifted points</p>
  
  <p>What I'm having trouble with is the resampling bit - how could I perform a weighted resampling in MATLAB?</p>
  
  <p>Please let me know if there's anything I should clarify!! Thanks!</p>