The !True returns False but how can I negate a boolean vector such as {True, False, True}? The exclamanation mark does not work here like this !{True,False,True}.
Asked
Active
Viewed 386 times
3
hhh
- 2,603
- 2
- 19
- 30
??NotshowsNotis not Listable. If a functionfoois Listable, then one can writefoo[{....}], and thenfoowill automatically by applied to each element in the list. For example, if you do??Sinyou'll see it says it is Listable. For non-listable functions, you can use Map, as inMap[Not,{True,False,True}]orNot[#] & /@ vetc... So, the first thing to always check is to do??in order to see if a function isListableor not. – Nasser Nov 09 '13 at 17:15Not[#] &can be written more concisely asNot. – Nov 09 '13 at 18:26