MathGroup Archive 1994

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

Search the Archive

Re: Using substitution rules to define a function

  • To: Jean.Peccoud at imag.fr, mathgroup at yoda.physics.unc.edu
  • Subject: Re: Using substitution rules to define a function
  • From: bert at netcom.com (Roberto Sierra)
  • Date: Thu, 31 Mar 1994 12:47:37 -0800

<<
could anybody explain me what happens here ?
Sol is a solution of an equation
[munge]

Here I want to define a function of w which returns the first solution.

In[34]:=

invf1[w_]:=sol[[1,1,2]]
invf1[x]
>>

Try this:

	invf1[w_] := Evaluate[ sol[[1,1,2]] ];

If you intend to use new expressions in sol down the line and want invf1
to use the latest/greatest expressions, then you can also use:

	invf1[x_] := sol[[1,1,2]] /. w->x;

Hope this helps...


-- Roberto Sierra
   Tempered MicroDesigns
   San Francisco, CA





  • Prev by Date: Re: Plotting 3D Surface Plots using data from an external file
  • Next by Date: Problem adding Text to plots
  • Previous by thread: Using substitution rules to define a function
  • Next by thread: Re: Using substitution rules to define a function