MathGroup Archive 2004

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

Search the Archive

Re: subscripted function variables


so spake Christopher Grinde [2004.08.25 @ 02:47]:
> Is there a way to use subscriptewd variable names in functions?
> 
> I have tried
> 
> f[Subscript[u,1]_]:=Subscript[u,1]^2
> 
> but I am not able to make this work.

because it won't. :)  mathematica function definitions expect
expressions with Head Symbol for function argument patterns, Subscript,
in this case, is not a valid Head.  If you really want subscripted
function variables, check out the Notation package.  this is definitely
not a user friendly way of going about this, but it should work if you
_really_ need it.

  <<Utilities`Notation`
  
  See the documentation of the notation package for more info.

    -ste\/e
--
/*-----------------------------*\
|       stephen layland         |
|  Technical Support Engineer   |
|     layland at wolfram.com       |
\*-----------------------------*/


  • Prev by Date: Re: subscripted function variables
  • Next by Date: Re: Multiple Regression
  • Previous by thread: Re: subscripted function variables
  • Next by thread: Multiple Regression