I have a table of dimension $M \times N \times Q$ of 3-tuples {x,y,z}
that represent points, and another table of dimension $M \times N \times Q$ of scalar values. I am trying to join the two tables together to be of the form {{x,y,z}',n'}
where {x,y,z}'
and n'
are the elements of each table at any given index.
Here is what I have so far, which generates the table of tuples and the table of scalar values
ot = ArrayReshape[Range[192], {4, 6, 8}];
x = Array[# &, 4, {-14, -7}];
y = Array[# &, 6, {225, 230}];
z = Array[# &, 8, {980, 1111}];
tup = ArrayReshape[Tuples[{z, y, x}], {4, 6, 8, 3}];
However, using Join[tup, ot]
does not do the joining of the tables as I would expect, where ot and tup are joined elementwise.
Transpose[{tup, ot}, {4, 3, 2, 1}]
orFlatten[{tup, ot}, {{4}, {3}, {2}, {1}}]
. $\endgroup$