A simple problem I am facing is here:
list1 = RandomReal[{1, 2}, {3, 4, 30}];
list2 = RandomReal[{10, 20}, {3, 4, 30}];
Map[Map[(# + 1+Min[#]) &, #] &, #] &/@list1;
works fine, but whenever such a nested Map
appears, I think there might be a better solution than what I am doing here.
Now my problem is if I want to use a MapThread
over the above function like the following, I stumble upon errors
MapThread[Map[Map[(# + 1/Min[#2]) &, #] &, #1] &, {list1, list2}];
Including this example and for even more nested situations, is there any general coding practice that is elegant, efficient and native to MMA functional language paradigm. Hope some one can help me with this type list manipulation here.
list2
important for the outerMapThread
. $\endgroup$&
. Try usingFunction
as @ruebenko answer. $\endgroup$