Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1994
*January
*February
*March
*April
*May
*June
*July
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1994

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

Search the Archive

Re: Using substitution rules to define a function

  • To: 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: Using substitution rules to define a function
  • Next by Date: problem
  • Previous by thread: Re: Using substitution rules to define a function
  • Next by thread: Re: Using substitution rules to define a function