Inserts a vector of elements into the given positions. elemToInsert is a
vector that can be as small as 1 element and as large as desired.
Position is an array of positions that can be as small as one element and
as large as the number of elements you wish to insert.
If position is smaller than the number of elements, this function will
assume that the remaining elements will be inserted sequentially.
If position is larger than the number of elements, this function will insert the
last element of elemToInsert at the remaining given positions.
This looks reasonably OK, but could be improved. However, it misses a H1 line (first line of the help section used by lookfor to get the name of a function based on key words) and an example. Moreover, it fails on certain inputs, like test([99 100],[5 5],1:10), without proper error message.
And did you look at INSERTROWS which has similar functionality: