Hi, need help reshaping an output from C that comes out in N (columns) 
vectors into a 2-D matrix

julia> C = pointer_to_array(DS.data, 2)
2-element Array{Ptr{Float64},1}:
 Ptr{Float64} @0x000000001bf17360
 Ptr{Float64} @0x000000001bf17970

and

julia> pointer_to_array(C[1], DS.n_rows)
186-element Array{Float64,1}:
 7.0
 6.99583
 6.99249
...

and I need to reshape these 2 columns into a 186x2 matrix but that's where 
all my attempts fails. I tried for example 

julia> hcat([pointer_to_array(C[k], DS.n_rows) for k=1:2])
2x1 Array{Array{T,N},2}:
 [7.0,6.99583,6.99249,6.98917,6.98639,6.98306,6.98029,6.97694,6.97417,6.97111 
 … 
 6.44916,6.44472,6.44056,6.43612,6.43139,6.42611,6.42167,6.41694,6.41306,6.4089]
 [53.3242,53.325,53.3264,53.3281,53.33,53.3314,53.3331,53.3344,53.3364,53.338 
 … 
 
53.6008,53.6017,53.6028,53.6033,53.6042,53.6047,53.6053,53.6061,53.6072,53.6075]

or

julia> cat(2,[pointer_to_array(C[k], DS.n_rows) for k=1:2])
2x1 Array{Array{T,N},2}:
 [7.0,6.99583,6.99249,6.98917,6.98639,6.98306,6.98029,6.97694,6.97417,6.97111 
 … 
 6.44916,6.44472,6.44056,6.43612,6.43139,6.42611,6.42167,6.41694,6.41306,6.4089]
 [53.3242,53.325,53.3264,53.3281,53.33,53.3314,53.3331,53.3344,53.3364,53.338 
 … 
 
53.6008,53.6017,53.6028,53.6033,53.6042,53.6047,53.6053,53.6061,53.6072,53.6075]

but that is not what I need,  as mentioned I need a Mx2 matrix.

Thanks

Joaquim

Reply via email to