MathGroup Archive 2001

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

Search the Archive

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
>
>
>
>



  • Prev by Date: Re: frameticks without numbers
  • Next by Date: Re: how to get an assignment from a rule ?
  • Previous by thread: Re: Replacing elements in matrix.
  • Next by thread: Re: Replacing elements in matrix.