Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


  • Prev by Date: RE: Bug in parsing expression?
  • Next by Date: RE: function IF with several equality conditions
  • Previous by thread: Re: vector problem I'm not sure how to express
  • Next by thread: RE: function IF with several equality conditions