MathGroup Archive 2006

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

Search the Archive

Re: Function argument


Bonny wrote:
> I would like to define a function g that evaluates another function f at a
> given value. That is,
>
> g[a, f[x]] := f[a]

Better to just refer to function f by name rather than having to pass
the evaluation of f at 'x' every time you call g:

g[a_,f_]:=f[a]

f[x_]:=a*x^2+b*x+c

g[f,1]

g[Pi,Sin]

--


  • Prev by Date: How can I use multiple filename ?
  • Next by Date: Re: Animate
  • Previous by thread: Re: Function argument
  • Next by thread: Re: Function argument