How to Create Queue Data Structure in Matlab

clear all
Q=[1 2 3 10 30 -5]
Q = 1×6
1 2 3 10 30 -5
%insert to the begining of Q
v=100;
Q=[v Q]
Q = 1×7
100 1 2 3 10 30 -5
%retrieve from the end
w=Q(end)
w = -5
Q(end)=[]
Q = 1×6
100 1 2 3 10 30
%As a side note, you can remove any element of Q by setting that element to [], the example below removes the third element
Q(3)=[]
Q = 1×5
100 1 3 10 30