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

• To: mathgroup at smc.vnet.net
• Subject: [mg75261] Re: how to make myVec[v,3] to return {v_1, v_2, v_3} ?
• From: dimitris <dimmechan at yahoo.com>
• Date: Mon, 23 Apr 2007 05:33:52 -0400 (EDT)
• References: <200704170025.UAA08976@smc.vnet.net><f0ekg4\$pq1\$1@smc.vnet.net>

```Hi.

Everything has been converted to InputForm.

Among many alternatives try this...

In[3]:=
myvec[v_, i_] := Array[v, i]

In[5]:=
myvec[v, 10]
% /. (a_)[i_] :> Subscript[a, i]

Out[5]=
{v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8], v[9], v[10]}

Out[6]=
{Subscript[v, 1], Subscript[v, 2], Subscript[v, 3], Subscript[v, 4],
Subscript[v, 5], Subscript[v, 6], Subscript[v, 7],
Subscript[v, 8], Subscript[v, 9], Subscript[v, 10]}

Dimitris

=CF/=C7 T.Sariyski =DD=E3=F1=E1=F8=E5:
> 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: Re: Interpreting the solutions... better this time
• Next by Date: Re: equation solving in a markov model
• Previous by thread: Re: how to make myVec[v,3] to return {v_1, v_2, v_3} ?
• Next by thread: Overlaying 3d plots