I have a 3d array, and would like to copy the bottom "slice", i.e. final row of all columns and dim3, and then paste it on the bottom of the original 3d array. For some reason Julia considers my "slice" as 2d array rather than a 3 d array and will not allow concatenating. Have tried several things, no luck. Thx. J MWE here.
If I start with this:
3×2×2 Array{Int64,3}:
[:, :, 1] =
1 4
2 5
3 6
[:, :, 2] =
1 4
2 5
3 6
I want to end up with this:
3×2×2 Array{Int64,3}:
[:, :, 1] =
1 4
2 5
3 6
3 6
[:, :, 2] =
1 4
2 5
3 6
3 6
a, b = [1;2;3], [4;5;6]
c = hcat(a,b)
d = cat(c,c,dims=3)
size(d)
e = d[3,:,:]
f = hcat(d,3)
ERROR: DimensionMismatch("mismatch in dimension 1 (expected 3 got 1)")