Say you have two lists:
listA = {a, b, c}
listB = {d, e, f}
How would you produce a listC that equates each of the two's elements, ie.
listC = {a == d, b == e, c == f}
?
I know, it's very easy, but somehow I've already spent an slightly embarrassing amount of time on this. I suspect it will involve Map
, but can't seem to get the elements to behave together per each element. It seems to just Append
the two together for some reason.
SetAttributes[listA, Listable]
SetAttributes[listB, Listable]
seems promising given this: http://reference.wolfram.com/mathematica/ref/Listable.html
Thread[listA == listB]
$\endgroup$listA
is equal tolistB
, thenThread[listA == listB]
will return justTrue
. In that case, this:MapThread[Equal, {listA, listB}]
. $\endgroup$