Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

Set in Scan

  • To: mathgroup at smc.vnet.net
  • Subject: [mg21856] Set in Scan
  • From: "Johannes Ludsteck" <ludsteck at zew.de>
  • Date: Wed, 2 Feb 2000 22:54:15 -0500 (EST)
  • Organization: Zentr. f. Europ. Wirtschaftsforsch
  • Sender: owner-wri-mathgroup at wolfram.com

Dear MathGroup members

I have to do replacements in very long lists. An efficient way to do 
this is to use

x[[index]]=newElement.

This, however, doesn't work if I want to do replacements for a set of 
lists. If I try to replace the third element in the lists v1, v2 and v3 by 
typing

Scan[#[[3]] = newElement &, {v1,v2,v3}]
I get the error message
Set::setps: #1 in assignment of part is not a symbol.

Any suggestions?
Thanks


Johannes Ludsteck
Centre for European Economic Research (ZEW)
Department of Labour Economics,
Human Resources and Social Policy
Phone (+49)(0)621/1235-157
Fax (+49)(0)621/1235-225

P.O.Box 103443
D-68034 Mannheim
GERMANY

Email: ludsteck at zew.de


  • Prev by Date: Re: Help! Mathematica on my 500MHz outperforms my GHz machine!
  • Next by Date: Check[] *and* Off[]
  • Previous by thread: Re: Re: Help! Mathematica on my 500MHz outperforms my GHz machine!
  • Next by thread: Re: Set in Scan