I’m not sure that an Array type is the answer for you.
If it is, nevermind … ![]()
In general, arrays may have 1,2,…n dimensions. Most of the time, people are working with Vectors, Matricies or other small dimension arrays. To create an array, one easy way is to create it zero-filled:
julia> element_type = Int
julia> nzeros = 4
julia> myvector = zeros(element_type, nzeros)
4-element Vector{Int64}:
0
0
0
0
To create a matrix, do something similiar
julia> element_type = Float32
julia> nrows = 3
julia> ncols = 4
julia> mymatrix = zeros(element_type, nrows, ncols)
3×4 Matrix{Float32}:
0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0
Of course you do not need to use the variables.
mymatrix = zeros(Float32, 3, 4) does the same thing.
For 3D arrays, use 3 counts
julia> my3Darray = zeros(Int, 4, 3, 2)
4×3×2 Array{Int64,3}:
[:, :, 1] =
0 0 0
0 0 0
0 0 0
0 0 0
[:, :, 2] =
0 0 0
0 0 0
0 0 0
0 0 0