How to shift elements of an array to the left without using loops in matlab?

I have a fixed sized array in Matlab. When I want to insert a new element I do the following:

  1. To make room first array element will be overwritten
  2. Every other element will be shifted at new location index-1 ---left shift.
  3. The new element will be inserted at the place of last element which becomes empty by shifting the elements.

I would like to do it without using any loops.

7
задан David Heffernan 11 April 2011 в 19:23
поделиться