Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Table of tables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113287] Re: Table of tables
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Fri, 22 Oct 2010 01:35:27 -0400 (EDT)

On 10/21/10 at 7:01 AM, luiz.melo at polymtl.ca (Luiz Melo) wrote:

>I'm actually looking for a function that operates only on the third
>row of each column-matrix terms(which happen to be complex in the
>example I gave), but leaves the other terms intact. Consider a
>different example:

>Let t = {{{-1, -1, -2}, {-1, -1, -3}}, {{-1, -1, -4}, {-1, -1,
>-5}}};

>how can I get

>{{{-1, -1, 2}, {-1, -1, 3}}, {{-1, -1, 4}, {-1, -1, 5}}};

>that is, in this case, I need a function that takes the Abs[] of the
>3rd row of each sub-matrix and leaves the other terms intact.

t/.{a__,b_?NumericQ}->{a,Abs[b]}

Will do the trick



  • Prev by Date: From list to list of arguments
  • Next by Date: Re: Release dates for Mathematica versions
  • Previous by thread: Re: Table of tables
  • Next by thread: Re: Table of tables