MathGroup Archive 2004

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

Search the Archive

Re: Notation Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47570] Re: Notation Question
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 16 Apr 2004 05:20:45 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <c5lfds$bqh$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

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