MathGroup Archive 2003

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

Search the Archive

Re: combine a list of lists with another list of lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40932] Re: combine a list of lists with another list of lists
  • From: "Dana DeLouis" <delouis at bellsouth.net>
  • Date: Thu, 24 Apr 2003 05:30:33 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Don't know if this idea will help as I'm new at this...

pts=Outer[List,{x1,x2,x3},{y1,y2,y3}]

{{{x1, y1}, {x1, y2}, {x1, y3}}, {{x2, y1}, {x2, y2}, {x2, y3}}, 
 {{x3, y1}, {x3, y2}, {x3, y3}}}

z=Partition[ToExpression[Table["z"<>ToString[j],{j,9}]],3]

{{z1, z2, z3}, {z4, z5, z6}, {z7, z8, z9}}

Table[Flatten[({pts[[r,c]],z[[r,c]]})],{r,3},{c,3}]

{{{x1, y1, z1}, {x1, y2, z2}, {x1, y3, z3}}, {{x2, y1, z4}, {x2, y2, z5}, 
  {x2, y3, z6}}, {{x3, y1, z7}, {x3, y2, z8}, {x3, y3, z9}}} 

-- 
Dana DeLouis 
Windows XP
$VersionNumber -> 4.2
= = = = = = = = = = = = = = = = = 
 
 
"sean kim" <shawn_s_kim at yahoo.com> wrote in message
news:b858o8$5s6$1 at smc.vnet.net...
> hello group 
> 
> I have a bit of list operation problem. 
> 
> let's say we have two lists, one list of lists of z values over time. 
> then another list of lists of x and y values over time
> 
> as follows for example,
> 
> {{z1, z2, z3}, {z4, z5, z6}, {z7, z8, z9}}
> 
> the number of the lists withing this list varies in actual problem
> 
> also condsider the following list of lists.
> 
> 
> {{{x1, y1}, {x1, y2}, {x1, y3}},
>  {{x2, y1}, {x2, y2}, {x2, y3}},
>  {{x3, y1}, {x3, y2}, {x3, y3}}}
> 
> now i would like to generate a new list that is of the form {xn, yn,
> zn} such that it can be plotted using ListPlot command
> 
> as..
> 
> {{{x1, y1, z1}, {x1, y2, z2}, {x1, y3, z3}},
>  {{x2, y1, z4}, {x2, y2, z5}, {x2, y3, z6}},
>  {{x3, y1, z7}, {x3, y2,z8}, {x3, y3,z9}}}
> 
> but it seems to me listplot3D will only plot if it's a single list of
> lists of xyz values. not multiple lists of lists as i have defined
> above. 
> 
> how can I first generate a new list using the preexisting list of lists
> as above and then plot them? 
> 
> much appreciate any help and comments. 
> 
> thanks again all. 
> 
> sean from UCIrvine



  • Prev by Date: Re: Sheer frustration with integration of piecewise continuous functions
  • Next by Date: Re: Sheer frustration with integration of piecewise continuous functions
  • Previous by thread: Re: combine a list of lists with another list of lists
  • Next by thread: RE: combine a list of lists with another list of lists