Try to add parentheses

*A[(A.>0.5)&(A.<0.9)]*
The expressions you posted reads 
A[ A .> (0.5&A) .< 0.9]

There is an open issue about the high precedence of &

Ivar

kl. 15:38:08 UTC+2 tirsdag 20. mai 2014 skrev Florian Oswald følgende:
>
> I have an array A that i want to subset, as in
>
> A = rand(100,100)
> A[A.>0.5]
>
> I'm struggling to find the extension of this to more than one rule - i 
> would have expected that to work:
>
> A[A.>0.5&A.<0.9]
> ERROR: no method &(Float64, Float64)
>  in & at array.jl:743
>
> how can I get a valid boolean index vector out of two? why does  A.>0.5 
> return a float and not a bool?
>

Reply via email to