How to access columns from Vector{SVector{4,Float64}}?

You’re calling getindex per element, you can also do that with broadcasting:

julia> u = fill(SVector{4,Float64}(1:4), 3)
3-element Vector{SVector{4, Float64}}:
 [1.0, 2.0, 3.0, 4.0]
 [1.0, 2.0, 3.0, 4.0]
 [1.0, 2.0, 3.0, 4.0]

julia> z = getindex.(u, 1)
3-element Vector{Float64}:
 1.0
 1.0
 1.0

julia> dz = getindex.(u, 2)
3-element Vector{Float64}:
 2.0
 2.0
 2.0
2 Likes