Hello,
For a Molecular Dynamics simulation I have created a composite type
named Particle. After that, I constructed an Array consisted of
Particle elements. I want to get the index of a specific element
within the Array, however when trying it I get the following error:
`start` has no method matching start(::Particle{Float64})
I believe the error is related to the fact I have not defined how to
iterate over an Array of Particle types. I don't know how I can do
that.
Any help will be appreciated. For concreteness, I put a simple code:
>>>
type Particle{T<:Float64}
r::T
v::T
end
p = Particle(1.0,1.0)
particles = [p]
for i in 1:10
p = Particle(rand(),rand())
push!(particles,p)
end
k = findin(particles, particles[3]) # I expect k = 3
`start` has no method matching start(::Particle{Float64})
>>>