Create indexing array with 'end' before vector exists
You can set up an anonymous function to act in a similar way
f_end = @(v) v(2:end);
A = [1 2 3];
B = [4 5 6 7];
f_end( A ); % = [2 3];
f_end( B ); % = [5 6 7];
I think this is the only way you could do it, since you can't set up an indexing array without knowing the end
index.