Re: mathematica question
- To: mathgroup at smc.vnet.net
- Subject: [mg9350] Re: mathematica question
- From: Paul E Howland <PEHowland at dera.gov.uk>
- Date: Sat, 1 Nov 1997 03:33:36 -0500
- Organization: DERA (Malvern)
- Sender: owner-wri-mathgroup at wolfram.com
Tom, Use the following: ToExpression["q"<>ToString[#]&/@{1,4,7,8}] Paul Tom wrote: > > Hello Mathematica users, > > I have a question that I hope someone has an answer for. I think it > should be simple but I cannot find a way to make it work. > > I have a set of functions that take no inputs, they are called q1[], > q2[], q3[] and so on. > > How can I get Mathematica to run the correct function given a list of > numbers as input. IE, if I supply the list {1,4,7,8} I would want > Mathematica to run the functions q1[], q4[], q7[] and q8[], assuming > they were defined. > > I would appreciate any assistance you might have with this!! > > Sincerely, > > Tom De Vries -- Paul E Howland PhD MEng CEng MIEE Room BY209 Senior Scientist DERA (Malvern) Land Systems Sector St Andrews Road Defence Evaluation & Research Agency Malvern tel. +44-(0)1684-895767 Worcestershire fax. +44-(0)1684-896315 UK Email PEHowland at dera.gov.uk Web Site http://www.dera.gov.uk Official Disclaimer: The views expressed above are entirely those of the writer amd do not represent the views, policy or understanding of any other person or official body.