Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'List of functions' topicStudent Support Forum > General > "List of functions"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
yehuda ben-shimol
12/31/06 04:06am

Hi,
The easiest way is to use Array
Array[y[#][t]&,3]
returns
Array[y[#][t] &, 3]

It is not recommended to work they way you did, since then you will have to interpret the name of each function to get its index.
Anyway, to make your code work (which is also highly inefficient) you should use ToExpression
for example
lis = {}; i = 1; While[i < 3, AppendTo[lis, ToExpression["y" <> ToString[i++] <> "[t]"]]]
or
lis = Table[ToExpression["y" <> ToString[i] <> "[t]"], {i, 3}]
yehuda

URL: ,

Subject (listing for 'List of functions')
Author Date Posted
List of functions Paul_Poland 12/27/06 08:48am
Re: List of functions yehuda ben-s... 12/31/06 04:06am
< Previous CommentHelp | Reply To Comment | Reply To Topic