Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: a question about subscript

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57950] Re: a question about subscript
  • From: Roland Franzius <roland.franzius at uos.de>
  • Date: Mon, 13 Jun 2005 05:51:18 -0400 (EDT)
  • Organization: Universitaet Hannover
  • References: <d892n4$sch$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Zhou Jiang schrieb:
> Hi,  my friends,
>  
> I want to take the advantage of the subscript in Mathematica 5.1.
> I defined a function like the following:
>  
> v[t_]=t+t1
>  
> Since this is a plane text, I cannot type in the subscript t1 (i.e., t sub 1) for you. This is so simple which represents a time translocation of t1. I want Mathematica to compute v[0] and it is supposed to give t1 (ie. t sub 1).  I typed in v[0] but Mathematica gives me 01 (i.e., 0 sub 1). Obviously it is not the correct answer. Can anyone give me some insight of this delima? Thanks a lot.

Since my posting didn't appear to appear I post again

Instead of using the notation packet I prefer to use fixed strings. Typo 
looks the same

v[t_]:=t+Subscript["t",1]

v[3]

Cell[BoxData[
     RowBox[{"3", "+",
       SubscriptBox["\<\"t\"\>", "1"]}]], "Output",
   CellLabel->"Out[5]="]

The string "t" cannot be confused with the pattern name in t_.

-- 

Roland Franzius


  • Prev by Date: Re: Plot3D slice
  • Next by Date: Re: Beginner's Question on I/O Files for Raw Numerical Data
  • Previous by thread: Re: Re: a question about subscript
  • Next by thread: Mathematica equivalent complexplot