I have a matrix and two lists:
matrix = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
a = {{1, 2, 2, 1}, {3, 4, 4, 3}, {8, 5, 5, 8}};
d = {{I, 2, -I}, {I, 1, -1}, {4, I, 0}};
I am trying to do write a code as psudo-code here to joined a and b and add them to matrix:
Do[matrix[[i, j]] = AppendTo[a[[i]], a[[j]]], {i, 0, 3}, {j, 0, 3}];
the desired result is as below
matrix =
{{{1, 2, 2, 1, 1, 2, 2, 1, d[[1, 1]]},
{1, 2, 2, 1, 3, 4, 4, 3, d[[1, 2]]},
{1, 2, 2, 1, 8, 5, 5, 8, d[[1, 3]]}},
{{3, 4, 4, 3, 1, 2, 2, 1, d[[2, 1]]},
{3, 4, 4, 3, 3, 4, 4, 3, d[[2, 2]]},
{3, 4, 4, 3, 8, 5, 5, 8, d[[2, 3]]}},
{{8, 5, 5, 8, 1, 2, 2, 1, d[[3, 1]]},
{1, 2, 2, 1, 3, 4, 4, 3, d[[3, 2]]},
{8, 5, 5, 8, 8, 5, 5, 8, d[[3, 3]]}}};
I would be so glad to have a way to obtain the result. Also, it will be good if I have a final matrix in horizontal shape for its sub_matrices in the nested final matrix instead of column shape for them.