I think this is not possible. Instead use a Vector, append! to that and then reshape in the end. The reshape should result in a view and not a copy, thus will be fast.
Mauro On Sat, 2016-02-13 at 10:51, Vishnu Raj <[email protected]> wrote: > Hi, > > I have a three dimensional array (say 'z' ) like this : > > julia> z > 4x3x3 Array{Int64,3}: > [:, :, 1] = > 1 5 9 > 2 6 10 > 3 7 11 > 4 8 12 > > [:, :, 2] = > 13 17 21 > 14 18 22 > 15 19 23 > 16 20 24 > > [:, :, 3] = > 25 29 33 > 26 30 34 > 27 31 35 > 28 32 36 > > Now I have a matrix 'z1' as > julia> z1 > 4x3 Array{Int64,2}: > 37 41 45 > 38 42 46 > 39 43 47 > 40 44 48 > > I want to put z1 at the end of third dimension of 'z'. So that the output > will be like > julia> z[*:,:,4*] > 4x3 Array{Int64,2}: > 37 41 45 > 38 42 46 > 39 43 47 > 40 44 48 > > I tried push!() and append!(), both gives me errors. > > Kindly suggest a way to do this. I want 'z' to grow in third dimension as > simulation progresses.
