I want to create a two dimensional array of 2D vectors (to represent a vector field).

My code is something like this

```
N=10
dx=1/(N-1)
dy=1/(N-1)
#initial data
U=fill(zeros(2), (N, N))
for i=1:1:N
for j=1:1:N
U[i,j][1]=(i-1)*dx
U[i,j][2]=(j-1)*dy
end
end
print(U[5, 7])
```

The result is [1.0, 1.0], which is not what I want. I have no idea why. However, if I change the code to something like this

```
N=10
dx=1/(N-1)
dy=1/(N-1)
#initial data
U=fill(zeros(2), (N, N))
for i=1:1:N
for j=1:1:N
U[i,j]=[(i-1)*dx, (i-1)*dx]
end
end
print(U[5, 7])
```

Then it print out the correct result, which is [0.4444444444444444, 0.6666666666666666]. So, what going on?

`Matrix{Vector{Float64}}`

will be inefficient, i.e. it will be slow, use up more memory than needed and may cause significant GC delays. Better store some immutable structure in your matrix, eg.`Tuple{Float64, Float64}`

. Of course in small examples like your it probably will not matter much.`SVector`

s from StaticArrays.jl