I am trying to create empty multidimensional arrays where each element of the array is a 2d Float64 array with variable numbers of elements.
I am finding this very counter-intuitive and I am still extremely confused with how Julia deals with this easy task. I read the manual and documentation a few times and could not find a simple, clear answer for this.
I tried several different ways found here and there on the Internet and none of them worked.
A = [Float64[] for i = 1:2 for j = 1:4]
correctly creates a 2 by 4 empty array where every element is a 1-d Float64 array. Since I need 2d arrays I tried the following:
A = [Array{Float64,2}[] for i=1:2 for j=1:4]
which results in the unexpected (for me) behavior of creating an array containing Array{Array{Float64,2},1} type of elements. Again not what I was looking for.
I understand this should be trivial but apparently it is not, at least for me.