MathGroup Archive 2003

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

Search the Archive

Re: defining a transform from two lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40843] Re: defining a transform from two lists
  • From: bobhanlon at aol.com (Bob Hanlon)
  • Date: Tue, 22 Apr 2003 06:42:33 -0400 (EDT)
  • References: <b80joq$m2n$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

m=3;

p1 = Table[{n[i],a[i]},{i,m}];

p2 = Table[{n[i],b[i]},{i,m}];

{#[[1,1]],f[#[[1,2]],#[[2,2]]]}& /@
  Transpose[{p1,p2}]

or 

 Transpose[{p1,p2}] /. 
  {{n_,a_},{n_,b_}}:>{n,f[a,b]}


Bob Hanlon

In article <b80joq$m2n$1 at smc.vnet.net>, "Nathan Moore" <nmoore at physics.umn.edu>
wrote:

<< 
Subject:	defining a transform from two lists
From:		"Nathan Moore" <nmoore at physics.umn.edu>
To: mathgroup at smc.vnet.net
Date:		Mon, 21 Apr 2003 11:13:30 +0000 (UTC)

Suppose I have two lists of similar length,
    p1={n[i],a[i]}
and
    p2 = {n[i],b[i]}
and I'd like to create a new list,
    p3 = { n[i], f[ a[i], b[i] ] }
if the new list comes from one parent list then it is relatively simple to
write and apply a transform w/ map like
    h[{x_,y_}]:={x,f[y]}
    newlist = h/@list or = Map[h,list]
but two parent lists confuse me

thanks again!

Nathan Moore,
University of Minnesota Physics













 >><BR><BR>


  • Prev by Date: Re: Solve[] handles the same system differently
  • Next by Date: small program in Mathematica
  • Previous by thread: Re: defining a transform from two lists
  • Next by thread: Re: defining a transform from two lists