Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*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 2006

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

Search the Archive

Re: matrix operations -- shared data vs copied

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65940] Re: matrix operations -- shared data vs copied
  • From: "Chris Chiasson" <chris.chiasson at gmail.com>
  • Date: Mon, 24 Apr 2006 06:01:49 -0400 (EDT)
  • References: <e2fkpu$bo8$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

If you don't want to use the data manipulation package, you could try:

letters={{a,b},{c,d}};
letterpos=Flatten[MapIndexed[#2&,letters,{2}],1];
numbers={{0,0,1},{0,1,0},{1,0,0}};
newmatrix=ReplacePart[numbers,letters,{1,1}+#&/@letterpos,letterpos];

MatrixForm[letters]
MatrixForm[numbers]
MatrixForm[newmatrix]


  • Prev by Date: Re: How to extract functions from a list and call them with any argument?
  • Next by Date: Re: How to extract functions from a list and call them with any argument?
  • Previous by thread: Re: matrix operations -- shared data vs copied
  • Next by thread: Re: matrix operations -- shared data vs copied