Re: function IF with several equality conditions
- To: mathgroup at smc.vnet.net
- Subject: [mg49092] Re: function IF with several equality conditions
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 1 Jul 2004 05:25:36 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <cbu37q$5m7$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, this is because you have not found the Mathematica Book AND the online help or you may not be able to read the Mathematica Book OR the online help You many mean a=1; Table[If[x1>a && x2<a,0,1],{x1,0,2},{x2,0,2}] or a=1; Table[If[x1>a || x2<a,0,1],{x1,0,2},{x2,0,2}] and Equal[] is "==" and not Set[] "=" a=1; Table[If[x==a,0,1],{x,0,2}] Regards Jens Mukhtar Bekkali wrote: > > I have two questions that HELP file of Mathematica does not address: > > (1) How do I implement IF with several conditions. I tried something like this > > a=1; > Table[If[{x1>a,x2<a},0,1],{x1,0,2},{x2,0,2}] > > and get no results. > > Also, (2) IF does not accept equality conditions either, say > > a=1; > Table[If[x=a,0,1],{x,0,2}] > > I am surprised that such simple things are not covered by help file. > > Thank you in advance, Mukhtar