Re: Replacing elements in matrix.
- To: mathgroup at smc.vnet.net
- Subject: [mg29344] Re: [mg29322] Replacing elements in matrix.
- From: BobHanlon at aol.com
- Date: Thu, 14 Jun 2001 02:27:22 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2001/6/13 3:43:28 AM, syftech at saad.org.il writes:
>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}.
>
m = Array[a, {5, 5}];
m[[2, Range[2, 4]]] = 0;
m
Bob Hanlon
Chantilly, VA USA