Probably, it would be easier to simply write a loop
u = trues(length(x))
u[[5, 7]] = false
ir = 0
vr = -Inf
for i = 1:length(x)
if u[i] && x[i] > vr
ir = i
vr = x[i]
end
end
# ir would be what you want
If are your list of numbers are all positive, you can write this in a more
concise way
ir = indmax(x .* u)
Dahua
On Monday, June 16, 2014 7:06:23 AM UTC-5, paul analyst wrote:
>
> I have a random vector x = rand (10)
> how to find the index of maximum but omitting to check any field eg not x
> [5,7]
> some like:
> indmax y = (x [but not read [5,7]])
> Paul
>