MathGroup Archive 2001

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

Search the Archive

Re: 2 equations 2 conditions

  • To: mathgroup at
  • Subject: [mg29171] Re: [mg29131] 2 equations 2 conditions
  • From: Tomas Garza <tgarza01 at>
  • Date: Fri, 1 Jun 2001 04:15:32 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

I think you may use Condition (see your Help browser or The Book):

w[z_, i_, j_] := firstFunction[z, L[i, j]] /; i > j;
w[z_, i_, j_] := secondFunction[z, L[i, j]] /; i <= j

This will automatically select what function to use according to whether i <
j or otherwise.

Tomas Garza
Mexico City

----- Original Message -----
From: "Su Su Win" <susuwin at>
To: mathgroup at
Subject: [mg29171] [mg29131] 2 equations 2 conditions

> 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: Re: Mathematica magazine formatting
  • Previous by thread: Re: 2 equations 2 conditions
  • Next by thread: plotting multiple polygons