November 2017
Beginner
316 pages
6h 40m
English
In the previous section, we studied arrays, matrices, and operations on them. In this section, we will study multidimensional arrays in Julia.
We will start by constructing a 3x3x3 multidimensional array using the rand() function, which generates random values:
# multidimensional arrayjulia> multiA = rand(3,3,3)3×3×3 Array{Float64,3}:[:, :, 1] =0.330416 0.927464 0.7673080.637868 0.17889 0.2741450.506475 0.790026 0.634805[:, :, 2] =0.850958 0.869152 0.9124930.125413 0.82839 0.01643930.039429 0.494712 0.891798[:, :, 3] =0.310575 0.679891 0.6391990.900038 0.475569 0.9541070.576849 0.261151 0.252355
We can access the values just as we accessed values in arrays and matrices, using the index:
julia> ...
Read now
Unlock full access