Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Conditionals >

Which

Which[test1, value1, test2, value2, ...]
evaluates each of the testi in turn, returning the value of the valuei corresponding to the first one that yields True.
  • If any of the testi evaluated by Which give neither True nor False, then a Which object containing these remaining elements is returned unevaluated.  »
  • You can make Which return a "default value" by taking the last testi to be True.
New in 1
© 2013 Wolfram Research, Inc. Japanese
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team