Consider an array of arrays
julia> a
2-element Array{Array{Float64,1},1}:
[1.0, 2.0, 3.0]
[4.0, 5.0, 6.0]
I want to convert a into an Array{Float64,2}
2×3 Array{Float64,2}:
1.0 2.0 3.0
4.0 5.0 6.0
like so.
I found out that one solution hcat(a...)'
julia> hcat(a...)'
2×3 Adjoint{Float64,Array{Float64,2}}:
1.0 2.0 3.0
4.0 5.0 6.0
Here type is Adjoint{Float64,Array{Float64,2}}. But for my problem, I need only Array{Float64,2}. And after some computations, I need to convert it back into array of arrays. I am wondering, what should be the best way to do this.
Thanks in advance.
Are you looking for vcat(a'...) It does what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With