BTW, what I really wanted to do is to generate a vector field on a 2D plane, say, the unit square, and draw that vector field using quiver plot in Plots.jl. So, here is an example on a very small grid.
julia> using LazyGrids # this allows to generate meshes like in MATLAB
julia> X, Y = ndgrid((collect(0:1), collect(0:1));
julia> X
2×2 LazyGrids.GridAV{Int64, 1, 2}:
0 0
1 1
julia> Y
2×2 LazyGrids.GridAV{Int64, 2, 2}:
0 1
0 1
julia> f(x,y) = [0.0 1.0; 1.0 0.0] * [x; y]; # Just a simple example of generating a vector at (x,y).
julia> A = f.(X,Y) # pointwise evaluation of f on the mesh
2×2 Matrix{Vector{Float64}}:
[0.0, 0.0] [1.0, 0.0]
[0.0, 1.0] [1.0, 1.0]
Then, in order to use quiver plot, I need to extract the first components and the second components:
quiver(X[:], Y[:], quiver=(getindex.(A,1)[:], getindex.(A,2)[:]))
Perhaps, there is a better way to generate a vector field, which can easily supply to the quiver plot…