Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2003
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

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

Search the Archive

Re: multiplying matrice rows

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44344] Re: [mg44269] multiplying matrice rows
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Wed, 5 Nov 2003 10:02:05 -0500 (EST)
  • References: <200311040823.DAA10440@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I hope I understood your problem correctly. Take e.g. matrix matA (5 x 4):

In[70]:=
matA = {{1, 4, 3, 2, -1}, {1, 1, 2, 7, 4},
    {9, 3, 3, 4, 7}, {-3, -2, 1, 3, 5}};

Suppose you want to multiply (term by term) row 1 by row 4, and replace row
1 by the result:

 In[1]:=
matA[[1]] = matA[[1]]*matA[[4]]
Out[2]=
{-3, -8, 3, 6, -5}

Then, in general,


In[3]:=
matA = {matA[[1]]*matA[[4]], matA[[2]]*matA[[4]],
   matA[[3]], matA[[4]]}
Out[3]=
{{-3,-8,3,6,-5},{-3,-2,2,21,20},{9,3,3,4,7},{-3,-2,1,3,5}}

Tomas Garza
Mexico City


----- Original Message ----- 
From: "Dragutin Culinovic" <dragutin.culinovic at fsb.hr>
To: mathgroup at smc.vnet.net
Subject: [mg44344] [mg44269] multiplying matrice rows


> How can I to multiply enumerated list of rows of an matrice on following
> way:
> To multyply each row (except rows a,b and c)of matrice A withe row a of
> the same matrice, and replace that row (not a row) with result.
>
> rows b and c are last rows, row a is any row in the range 1->b(exclusive)
>
> THX
>



  • Prev by Date: Re: Antw: pdf-export
  • Next by Date: exporting a list of functions for use in a C function
  • Previous by thread: multiplying matrice rows
  • Next by thread: Re: multiplying matrice rows