MathGroup Archive 2007

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

Search the Archive

Get list of function variables?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83258] Get list of function variables?
  • From: Jason Quinn <jason.lee.quinn at gmail.com>
  • Date: Fri, 16 Nov 2007 05:30:13 -0500 (EST)

This seems simple but how do I get the arguments to an arbitrary
function? Ideally something like getVariables[f] that just accepts the
function name as its argument.

If I have f[x_,y_]:=a*x^2+b*y^2,  getVariables[f] should return {x,y}
If I have g[n_,m_]:=a*n^2+b*m^2, getVariables[g] should return {n,m}
If I have h[w_,x_,y_,z_]:=A*w*x*y*z+B, getVariables[h] should return
{w,x,y,z}

Thanks for any suggestions,
Jason


  • Prev by Date: RegionPlot ignores the AxesLabel Option?
  • Next by Date: Re: Default value for Dynamic InputField
  • Previous by thread: Re: RegionPlot ignores the AxesLabel Option?
  • Next by thread: Re: Get list of function variables?