Normalize a collection of arrays on a specific column

• To: mathgroup at smc.vnet.net
• Subject: [mg85897] Normalize a collection of arrays on a specific column
• From: Curtis Osterhoudt <cfo at lanl.gov>
• Date: Wed, 27 Feb 2008 04:24:07 -0500 (EST)
• Organization: LANL

```(Note: this is a re-send of a message. I haven't seen the message show up in
the list (or its archives), so I'm assuming it's lost in the aether. I
apologize if this shows up twice.)

Hi, all,

I'm looking for a relatively efficient (read: not doing so
element-by-element) way of taking a collection of several matrices, all of
the same m x n dimensions (say), and normalizing all of them in
whatever column I choose. If possible, it would be nice to extend this
to any number of dimensions, but that's not necessary now.

For example, I'm looking for a function, "normalizeColumn[listOfLists_,
p_]" which would normalize the pth column of all of the lists, not
individually, but over the whole set, returning the whole set with just
the pth column changed in each of its constituent lists.

Let dat1 = {{1,3,4}, {2,2,-5}, {1,1,1}} and dat2 = {{0, 3, 6},
{2,1,4}, {5, 3, -5}}. Then if dat3 = {dat1, dat2}, the normalizeColumn
function should return

normalizeColumn[dat3, 2] = {{{1, 1, 4}, {2, 1/2, -5}, {1, 0, 1}},
{{0, 1, 6}, {2, 0, 4}, {5, 1, -5}}}.

I'm quite certain there's an easy way to do it; I should be able to do
something analogous on several hundred, 200 x 200 matrices at the same
time.

Best wishes, and thanks,
Curtis O.

--
==========================================================
Curtis Osterhoudt
cfo at remove_this.lanl.and_this.gov
PGP Key ID: 0x4DCA2A10
Please avoid sending me Word or PowerPoint attachments
See http://www.gnu.org/philosophy/no-word-attachments.html
==========================================================

```

• Prev by Date: Re: Another question on Assuming
• Next by Date: Re: Another question on Assuming
• Previous by thread: Re: Re: Re: Version 6.0.2
• Next by thread: Re: Normalize a collection of arrays on a specific column