MathGroup Archive 2001

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

Search the Archive

Re: Subscripted variables and FindRoot?

  • To: mathgroup at
  • Subject: [mg26719] Re: Subscripted variables and FindRoot?
  • From: Brian Higgins <bghiggins at>
  • Date: Thu, 18 Jan 2001 00:57:21 -0500 (EST)
  • References: <943eq7$>
  • Sender: owner-wri-mathgroup at

A pattern variable in the definition of a function must be a
Mathematica Symbol. A subscripted variable is a composite box
structure, and so cannot be used as a pattern variable.
Using your notation, the subscripted varible Xx is stored as
Subscript{X,x], and not as asymbol. However, if you load the
Notation package


Then you can use the Symbolize function to turn the Subscript[X,x]
into a Symbol. Thus


You can now  use Xx as a pattern variable, but be sure to place a
colon after the symbolize variable in the pattern definition. i.e


Use the palette to enter Symbolize.



You can use the Notation packageIn article
<943eq7$cpr at>,
  Mike Yukish <may106 at> wrote:
> Hello,
> I love using subscripted variables for readability, but they seem
> have their limitations. FindRoot[ ] seems to burp when presented
with a
> function that takes a subscripted variable as input. Also, and
> related, how do you declare a subscripted variable as a pattern
for a
> function? Patterns and subscripts seem to clash.
> This is no problem...
> foo[x_]:= x^2
> This is a problem (read Xy as x-subscripted-y)
> foo[Xy_] := Xy^2
> Where it does not recognize compute z^2 when presented with
> foo[z]
> Any hints on how to work with them?

Sent via

  • Prev by Date: Re: Switching Output Format Type for a single cell
  • Next by Date: Re: 3D-Plots: Coloring edges (simple)
  • Previous by thread: Subscripted variables and FindRoot?
  • Next by thread: Multiple choice question