MathGroup Archive 2005

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

Search the Archive

MapThread

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56998] MapThread
  • From: Swati Shah <swatshah at gmail.com>
  • Date: Thu, 12 May 2005 02:32:41 -0400 (EDT)
  • Reply-to: Swati Shah <swatshah at gmail.com>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Everyone,

I have been working on the following problem:

states = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}

stim = {33, 44, 55, 66, 77}


The locations of state 3,5,7,9,11 to be equal 33,44,55,66,77

MapThread[{#1 = #2} &, {Take [states, {3, 12, 2}], stim}]

I tried to the above but it gives me errors:
Set::setraw: Cannot assign to raw object 3

However these work individually:
MapThread[#1 &, {Take [states, {3, 12, 2}], stim}]
MapThread[ #2 &, {Take [states, {3, 12, 2}], stim}]

Any ideas?

Thanks in advance


  • Follow-Ups:
  • Prev by Date: Output to a file
  • Next by Date: Re: Remote Kernel
  • Previous by thread: Re: Output to a file
  • Next by thread: Re: MapThread