oops - i could swear i tried that!

sorry. thanks.


On 20 May 2014 14:41, Samuele Carcagno <sam.carca...@gmail.com> wrote:

> On 20/05/14 14:38, Florian Oswald wrote:
>
>> 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:nomethod &(Float64,Float64)
>> |
>>   in & at array.jl:743
>>
>
> you can use parentheses
>
> A[(A.>0.5) & (A.<0.9)]
>
>
>
>> how can I get a valid boolean index vector out of two? why does A.>0.5
>> return a float and not a bool?
>>
>
> `A.>0.5` does return a boolean array
>
> Sam
>

Reply via email to