Re: 2 equations 2 conditions
- To: mathgroup at smc.vnet.net
- Subject: [mg29177] Re: 2 equations 2 conditions
- From: Flip at safebunch.com
- Date: Fri, 1 Jun 2001 04:15:39 -0400 (EDT)
- References: <9f4dqa$a7c$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hello, there are several ways to do it. You can use If or Which. Example: (* if[condition, true, false] *) In[54]:= w[i_,j_]:=If[i > j, Print["Eq 2"],Print["Eq 1"]] In[55]:= w[1,2] Eq 1 In[56]:= w[2,1] Eq 2 Of course you would substitute your eq1 and eq2 appropriately. Cheers ... Wilson In article <9f4dqa$a7c$1 at smc.vnet.net>, Su Su Win says... > >Hello, > >I have problem. I am sorry if my question is very simple because I am only >beginner and trying to familiar with for Mathematica. > >I have 2 equations to calculate W(i,j)=Function of (z, L(i,j)). >Equation(1) is used when i>j and Equation(2) when i<=j. >If I have to use if...then, how can i ask Mathematica to take the correct >equation according to condition? >Thanks a lot. > >Win > >