The two solutions has been solved the question. Thanks. For last, if I do not wanna remove in a specific case and I use k=0:
%Number from last to delete
k=0;
%deletion
number(end-k+1) = []
Will it remove the last number if I define at the beguining of the code k=0? Or, how would be if I decide to remove multiple positions? e.g. the 8t and the third to last elements?