So I have a list of values
truthValues = {True, True, False}
and for each element of the list, I would like to return a different value if that element is true or not. So I would like to return this array if everything is true:
trueList = {1, 1, 1}
And this array if everything is false:
falseList = {0, 0, 0}
So for the list of values above, I would like to return
{1, 1, 0}
But the If[] function doesn't appear to support this directly, and the Apply function doesn't seem to do the trick either. Ideas?
0
/1
, you could trytruthValues /. {True -> something, False -> somethingElse}
$\endgroup$