I'm not sure I understand your question, but I think you mean this:
A = [ A(1:pos) newElem A((pos+1):end) ]
This will add the variable (or array) newElem after the position of pos to array A
Let me know if this works for you!
[Edit] Well, it looks like you just want to use an array as a shift register. You can do it as follows:
A = [ A(2:end) newElem ]
This will take all elements from the 2nd to the last of A and add your newElem variable (or array) to the end.
Darhuuk
source share