Reputation: 977
l have a vector of 1000 values l want to divide this 10000 values in different files
m=rand(1000)
vector[1]=m[1:150]
vector[2]=m[151:450]
vector[3]=m[450:800]
vector[4]= m=[801:1000]
it's not working l got this error
ERROR: UndefVarError: vector not defined
in eval(::Module, ::Any) at ./boot.jl:237
then l tried to set an empty vector
vector = Vector{Float64}
it remains not working
then l did a loop
for i in 1:4
vector[i]=Vector{Float64}
end
l got the same error
Upvotes: 0
Views: 105
Reputation: 3940
Try
vector = Vector()
push!(vector, m[1:150])
.
.
.
push!(vector, m[801:1000])
Upvotes: 1