Re: Multiply a constant to a matrix column
- To: mathgroup at smc.vnet.net
- Subject: [mg16285] Re: Multiply a constant to a matrix column
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Sun, 7 Mar 1999 01:05:26 -0500
- Organization: University of Western Australia
- References: <7bo0gg$dop@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hyo ahn wrote: > I would like to multiply a constant number to a certain column of an existing > matrix in Mathematica and I am having a hard time. > > First, I have a 1000 x 3 matrix A. There is no command that allow me to > multiply a constant number to a specific column (let say I want to multiply > 100 to the second column), Here are two ways: [1] {1, 100, 1} # & /@ A [2] Transpose[Transpose[A] {1, 100, 1}] Cheers, Paul ____________________________________________________________________ Paul Abbott Phone: +61-8-9380-2734 Department of Physics Fax: +61-8-9380-1014 The University of Western Australia Nedlands WA 6907 mailto:paul at physics.uwa.edu.au AUSTRALIA http://www.physics.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________