I have looked around for an answer to this but could not see anything relevant.
I am timing some (Matlab) code and there is one part which takes up a large amount of time. I have a vector, V, of integers (that may contain repeats) and I have a much smaller vector, v, contain indices of elements that I wish to delete. I am currently implementing this as:
V(v) = [];
'V' is something that I am selecting indices from at random and without replacement. 'v' must not contain duplicates.
Any suggestions?