MathGroup Archive 2001

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

Search the Archive

Re: 2 equations 2 conditions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29159] Re: 2 equations 2 conditions
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 1 Jun 2001 04:15:23 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <9f4dqa$a7c$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

you can do both 

L[i_Integer,j_Integer,z_]:=If[i<=j,Sin[z],z^2]

or

L[i_Integer,j_Integer,z_] /; i<=j:=Sin[z]
L[i_Integer,j_Integer,z_] :=z^2

the last one is the better more Mathamtica like version.

Regards
  Jens

Su Su Win wrote:
> 
> 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


  • Prev by Date: Re: I hate using Legend
  • Next by Date: Compound Expressions
  • Previous by thread: Re: 2 equations 2 conditions
  • Next by thread: Re: 2 equations 2 conditions