Re: Replacing elements in matrix.
- To: mathgroup at smc.vnet.net
- Subject: [mg29353] Re: [mg29322] Replacing elements in matrix.
- From: Carlos Collier <ccollier at tycho.fciencias.unam.mx>
- Date: Thu, 14 Jun 2001 02:27:29 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On Wed, 13 Jun 2001, Yoram Pollack wrote: Use Part[], for example : m = Table[Random[], {5}, {5}]; m[[2, Range[2, 4]]] = {0, 0, 0} (*this replaces the elements you want*) m Saludos Carlos > Hello there, > what will be the best way to replace a few successive elements in one row in > a matrix (but not the whole row)? > For example, in 5x5 matrix, replace elements 2,3,4 of row 2 by {0,0,0}. > Many thanks > Yoram > > > >