MathGroup Archive 2004

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

Search the Archive

Re: Notation Question


Hi,

Unprotect[Subscript];
SetAttributes[Subscript, HoldFirst]

Subscript[a_, i_Integer] := Part[a, i]

Protect[Subscript];


and

lst = Array[a, {5}];


Subscript[lst,4] gives a[4]

Regards
  Jens


Sebastian Cohen S wrote:
> 
> Hi everyone,
> 
> I need to make Mathematica understand that:
> 
> Subscript[X,j] for j = 3
> 
> for example is Part[X,3] and more generally to understand that:
> 
> the input should internally handle Subscript[exp, i,j]
> as Part[exp, i,j]
> 
> Anyone got any ideas?
> 
> Thanks in advance,
> 
> Sebastian Cohen S


  • Prev by Date: Filterquestion
  • Next by Date: Re: How to check if a file exists?
  • Previous by thread: Re: Notation Question
  • Next by thread: Re: Notation Question