MathGroup Archive 2008

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

Search the Archive

Re: Assignment problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86256] Re: Assignment problem
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Fri, 7 Mar 2008 02:26:26 -0500 (EST)
  • References: <fqo8o1$suo$1@smc.vnet.net>

Marco Gabiccini schrieb:
> Hi all,
>
> I would like to do something like:
>
> For[ i=1, i<n, i++, ToExpression[ "q" <> ToString[i] ] = 0 ]
>
> that is assigning q1=0, q2=0, etc... but it does not work.
>
> I would not like to use the easy way out:
>
> For[ i=1, i<n, i++, q[i] = 0 ]
>
> of employing q[i] instead of qi.
>
> Can you help me please?
>
> Thanks,
>
> Marco

Do you want something like this:

Table[ToExpression["q"<>ToString[i]]==0,{i,10}]

Gruss Peter
-- 
==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: Apply function to parts of a list
  • Next by Date: Re: Apply function to parts of a list
  • Previous by thread: Re: Assignment problem
  • Next by thread: Re: Assignment problem