I have the following code:
using StaticArrays
function test()
X = range(0, stop=10, length=8)
X_vec = Vector{MVector{8, Float32}}(undef, 10)
for i in range(1, stop=10)
X_vec[i] = X
end
return X_vec
end
I get the following output:
julia> vec=test()
10-element Vector{MVector{8, Float32}}:
[0.0, 1.4285715, 2.857143, 4.285714, 5.714286, 7.142857, 8.571428, 10.0]
[0.0, 1.4285715, 2.857143, 4.285714, 5.714286, 7.142857, 8.571428, 10.0]
[0.0, 1.4285715, 2.857143, 4.285714, 5.714286, 7.142857, 8.571428, 10.0]
[0.0, 1.4285715, 2.857143, 4.285714, 5.714286, 7.142857, 8.571428, 10.0]
[0.0, 1.4285715, 2.857143, 4.285714, 5.714286, 7.142857, 8.571428, 10.0]
[0.0, 1.4285715, 2.857143, 4.285714, 5.714286, 7.142857, 8.571428, 10.0]
[0.0, 1.4285715, 2.857143, 4.285714, 5.714286, 7.142857, 8.571428, 10.0]
[0.0, 1.4285715, 2.857143, 4.285714, 5.714286, 7.142857, 8.571428, 10.0]
[0.0, 1.4285715, 2.857143, 4.285714, 5.714286, 7.142857, 8.571428, 10.0]
[0.0, 1.4285715, 2.857143, 4.285714, 5.714286, 7.142857, 8.571428, 10.0]
This looks like a Matrix, but it isn’t. How can I get the n-th column out of this vector of MVectors?
This does not work:
vec[:, 2]