MathGroup Archive 2005

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

Search the Archive

Re: Defining functions using the output of an other function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59609] Re: Defining functions using the output of an other function
  • From: albert <awnl at arcor.de>
  • Date: Sun, 14 Aug 2005 04:37:59 -0400 (EDT)
  • References: <ddk892$167$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Eckhardt,

the following is one of plenty possibilities to achieve what you probably
were looking for (I have replaced = by == within Solve, otherwise it
doesn't make much sense):

y[x_] = y /. First[Solve[y == x^2, y, x]]

note that I am using Set (=) instead of SetDelayed (:=) for the definition
of y[x_] so the RHS will be evaluated. First will pick the first solution
out of possibly many.

Of course, in more realistic circumstances you might need a smarter way to
decide which solution you want to pick...


Albert


  • Prev by Date: Re: Using the VectorCalculus
  • Next by Date: Re: Re: Units, simplification
  • Previous by thread: Re: Defining functions using the output of an other function
  • Next by thread: Re: Defining functions using the output of an other function