Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: how to make myVec[v,3] to return {v_1, v_2, v_3} ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg75275] Re: how to make myVec[v,3] to return {v_1, v_2, v_3} ?
  • From: dh <dh at metrohm.ch>
  • Date: Mon, 23 Apr 2007 05:41:11 -0400 (EDT)
  • References: <200704170025.UAA08976@smc.vnet.net> <f0ekg4$pq1$1@smc.vnet.net>


Hi Ted,

try:

fun[x_]:=Table[Subscript[x,i],{i,1,3}];

hope this helps, Daniel



T.Sariyski wrote:

> Hi,

> 

> I want to define a function that takes a symbol and integer and 

> generates a vector e.g. myVec[v,3] returns  {v_1, v_2, v_3}? I tried

> 

> Table[v_Subscript_i, {i, 1, 3}]

> 

> but it returns {v_i, v_i, v_i}

> 

> Thanks,

> Ted

> 

> 

> In[1406]:=

> Table[v\[UnderBracket]Subscript\[UnderBracket]i, {i, 1, 3}]

> 

> 




  • References:
    • Publicon
      • From: Michael Alexander <malexand@wu-wien.ac.at>
  • Prev by Date: Re: Gauss-Kronrod algorithm
  • Next by Date: Re: Outputting to file with fixed decimal digits
  • Previous by thread: how to make myVec[v,3] to return {v_1, v_2, v_3} ?
  • Next by thread: Re: how to make myVec[v,3] to return {v_1, v_2, v_3} ?