MathGroup Archive 2001

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

Search the Archive

Re: 2 equations 2 conditions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29165] Re: [mg29131] 2 equations 2 conditions
  • From: BobHanlon at aol.com
  • Date: Fri, 1 Jun 2001 04:15:27 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 2001/5/31 12:40:37 AM, susuwin at post.kek.jp writes:

>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?
>

Look up condition in the on-line help then go to its Further Examples.

W[i_, j_] := f1[z, L[i, j]] /; i > j;
W[i_, j_] := f2[z, L[i, j]] /; i <= j;

W[5, 3]

f1[z, L[5, 3]]

W[3, 5]

f2[z, L[3, 5]]


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: Re: Mathematica to PowerPoint
  • Next by Date: Re: 2 equations 2 conditions
  • Previous by thread: freebsd...
  • Next by thread: Re: 2 equations 2 conditions