Re: Matrix operation
- To: mathgroup at smc.vnet.net
- Subject: [mg125774] Re: Matrix operation
- From: Dana DeLouis <dana2010 at me.com>
- Date: Mon, 2 Apr 2012 04:22:07 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
> - s2[i, j] = s1[i, j] + 4 * s1[i - 1, j] where i == 4
Hi. Just another option similar to others:
(Not sure if you meant a negative sign in front, but easy to adjust)
s2 = s1;
r = 4;
s2[[r]] = s2[[r]] + 4*s2[[r - 1]];
= = = = = = = = = =
HTH :>)
Dana DeLouis
Mac & Math 8
= = = = = = = = = =
On Mar 31, 4:46 am, Andrey Demidov <andrey.demi... at gmail.com> wrote:
> Hi,
>
> I have a matrix:
>
> >> s1 = {{0, 4, 3, 6, 1, 0, 0, 30}, {0, 6, 16, 8, 0, 1, 0, 256}, {0, 4, 1,
>
> 10, 0, 0, 1, 9}, {1, -2, -4, -3, 0, 0, 0, 0}}
>
> >> MatrixForm[s1]
>
> Now, I need to get another matrix (s2) where:
>
> - s2[i, j] = s1[i, j] where i <> 4
> - s2[i, j] = s1[i, j] + 4 * s1[i - 1, j] where i == 4
>
> What is the best way to get s2 ?