MathGroup Archive 2010

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

Search the Archive

Question on defaults in positional arguments

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112580] Question on defaults in positional arguments
  • From: NP <nomplume69 at gmail.com>
  • Date: Tue, 21 Sep 2010 02:03:56 -0400 (EDT)

Hi,

I was wondering if there was a way in selectively specifying some of
the arguments of a function (rest remaining default). For instance,
consider
Clear[f, x, y,z];
f[x_: 1, y_: 2,z_:3] := {x, y}
f[5]

{5,2,3}

Here the default values of y and z are automatically used. How can I
call f so that, for example,  the default value of x  and z are used
instead?

Thanks,

NP


  • Prev by Date: Wolfram Research, NVIDIA Collaborate to Provide Integrated GPU
  • Next by Date: mathematica code for DWBA calculation
  • Previous by thread: Wolfram Research, NVIDIA Collaborate to Provide Integrated GPU
  • Next by thread: Re: Question on defaults in positional arguments