title: Create a buffer matrix for continuous measurements
body: <p>I'm starting programming in MATLAB and I have some problems creating a buffer matrix. I'm trying to do the following:</p>
  
  <p>I'm continuously obtaining an image from a webcam and after segmentation I obtain the centroid of a moving target. I need to store the centroid data for processing but I don't want it to occupy too much memory. For example, if I was a time <code>t=inf</code>, I was thinking of storing 10 time points of data in a matrix, like a circular buffer, then writing and erasing the older data, because I need work with both, the actual data in time (t) and a previous data in time (t-1). </p>