I have two list which are not equal dimension:
listA = {{{1, 2}, {2, 2}, {3, 4}}, {{1, 1}, {2, 2}, {3, 3}}};
listB = {{4, 4}, {5, 5}};
And I want to divide them or multiply the such as the results has the same dimensions, for the first dimension, it should look like:
(#*listB[[1]]) & /@ listA[[1]]
but I would like to do it all at once so that the result has the same dimension as listA
. I bet it has probably been answered here but I cannot seem to find it. Therefore link to an existing answer is also great.
Table[(#*listB[[i]]) & /@ listA[[i]], {i, Length[listB]}]
$\endgroup$ – bill s Sep 23 '16 at 21:18MapThread[(Function[{x}, x #2] /@ #1) &, {listA, listB}]
? $\endgroup$ – march Sep 23 '16 at 21:48