The problem is that `a .> 5` is a BitArray, not a function.
~~~
julia> a = rand(10) * 10
10-element Array{Float64,1}:
5.5408
5.52724
2.87541
1.59491
0.278013
1.56604
8.29388
8.27159
0.737642
7.40957
julia> find(x->x>5,a)
5-element Array{Int64,1}:
1
2
7
8
10
~~~
When you call `find(a .> 5)`, you're using a different method of find:
~~~
julia> help(find)
Base.find(A)
Return a vector of the linear indexes of the non-zeros in "A"
(determined by "A[i]!=0"). A common use of this is to convert a
boolean array to an array of indexes of the "true" elements.
~~~
-- Leah
On Sat, Jul 12, 2014 at 12:00 PM, <[email protected]> wrote:
> Big thx.
> In documentation is :
> find(f, A)
> Return a vector of the linear indexes of A where f returns true.
> (function, OBJECT)
> What You think, s it error in documention ?
> Paul
>
>
> W dniu sobota, 12 lipca 2014 17:52:05 UTC+2 użytkownik Cameron McBride
> napisał:
>>
>> julia> find( a .> 5 )
>>
>> cheers,
>>
>> Cameron
>>
>>
>> On Sat, Jul 12, 2014 at 11:40 AM, paul analyst <[email protected]>
>> wrote:
>>
>>> I need all indexes where a[:] >5
>>>
>>> julia> a=rand(10)*10
>>> 10-element Array{Float64,1}:
>>> 4.84005
>>> 8.29994
>>> 8.8531
>>> 3.42319
>>> 2.60318
>>> 7.25313
>>> 0.816263
>>> 4.44463
>>> 6.71836
>>> 4.65337
>>>
>>> julia> a.>5
>>> 10-element BitArray{1}:
>>> false
>>> true
>>> true
>>> false
>>> false
>>> true
>>> false
>>> false
>>> true
>>> false
>>>
>>> julia> find(a.>5,a)
>>> ERROR: no method find(BitArray{1}, Array{Float64,1})
>>>
>>> julia> find([a.>5],a)
>>> ERROR: no method find(BitArray{1}, Array{Float64,1})
>>>
>>> julia>
>>>
>>>
>>