I have an array a=rand(100), I want to get every value except the values at the indices notidx=[2;50]. Is there a clean way to get a a
a=rand(100)
notidx=[2;50]
a
I don't have anything super clean, but you can do
a[setdiff(1:end, notidx)]
which is slightly cleaner than what you had, or
ind = trues(length(a)) ind[notidx] = false a[ind]
which is pretty verbose but very clear.