Reshape a tridimentional matrix

Hello.

I wrote a code in Julia 4.7 that uses a reshape of a 3D matrix just like this:

a = ones(2,2)
b = ones(2,2)
c = ones(2,2)

d = reshape([[a],[b],[c]], (2,2,3)

The code used to work ( on version 0.4.7 (check it working here)

But on 0.5.0 the reshape has changed and it my code no longer works

My question is: How can I create my (2,2,3) matrix in 0.5.0 from my (2,2) matrices?

This is not a tridimentional matrix. Please follow the deprecation warning on 0.4.x.

julia> d = reshape([[a],[b],[c]], (2,2,3))
WARNING: [a] concatenation is deprecated; use collect(a) instead                  
 in depwarn at ./deprecated.jl:73                                                 
while loading no file, in expression starting on line 0                           
WARNING: [a] concatenation is deprecated; use collect(a) instead                  
 in depwarn at ./deprecated.jl:73                                                 
while loading no file, in expression starting on line 0                           
WARNING: [a] concatenation is deprecated; use collect(a) instead                  
 in depwarn at ./deprecated.jl:73                                                 
while loading no file, in expression starting on line 0                           
WARNING: [a,b,...] concatenation is deprecated; use [a;b;...] instead             
 in depwarn at ./deprecated.jl:73                                                 
while loading no file, in expression starting on line 0                           
2x2x3 Array{Float64,3}:                                                           
[:, :, 1] =                                                                       
 1.0  1.0                                                                         
 1.0  1.0                                                                         
                                                                                  
[:, :, 2] =                                                                       
 1.0  1.0                                                                         
 1.0  1.0                                                                         

[:, :, 3] =
 1.0  1.0
 1.0  1.0
julia> d = reshape([a; b; c], (2,2,3))
2×2×3 Array{Float64,3}:
[:, :, 1] =
 1.0  1.0
 1.0  1.0

[:, :, 2] =
 1.0  1.0
 1.0  1.0

[:, :, 3] =
 1.0  1.0
 1.0  1.0
3 Likes