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]