Hi Guys!!!
I am trying to create a vector of vectors since I need the data structure to have a fixed number of rows(6) but variable number of columns. And in each of the units of the data structure I want to store an instance of a structure. My code is:
struct abc
a::Float64
b::Float64
c
end
k = Vector{Vector{abc}}(6);
for i = 1:6
for j = 1:6
aa, bb, cc = i+1, j+1, rand(3);
instance = abc(aa, bb, cc);
k[i][j] = instance;
end
end
I’m getting this error:
UndefRefError: access to undefined reference
Stacktrace:
[1] getindex(::Array{Array{abc,1},1}, ::Int64) at ./array.jl:549
[2] macro expansion at ./In[7]:5 [inlined]
[3] anonymous at ./:?
Can you guys tell me what I am doing wrong? Thanks!