Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Creating List

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125552] Re: Creating List
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sun, 18 Mar 2012 02:46:21 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201203170751.CAA05090@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

Here's one way:

   {iend, jend} = {4, 3};
   xvals = Table[xkoor[i], {i, iend}];
   yvals = Table[ykoor[j], {j, jend}];

   Outer[List, xvals, yvals] // Flatten[#, 1] &

On 3/17/12 3:51 AM, Harry wrote:
> Hi out there,
>
>
> I have calculated some x- and y-values and want to combine them in a
> way that the x and y-values define coordinates. Well, I have:
>
> xkoor[i], {i, 1, iend} and
> ykoor[j], {j, 1, jend}
>
>
> To be able to continue I need this list:
>
> {{xkoor[1],ykoor[1]},
>   {xkoor[2],ykoor[1]},
>   {xkoor[3],ykoor[1]},
>   {xkoor[4],ykoor[1]},
>   {xkoor[1],ykoor[2]},
>   {xkoor[2],ykoor[2]},
>   {xkoor[3],ykoor[2]},
>   {xkoor[4],ykoor[2]},
>   {xkoor[1],ykoor[3]},
>   {xkoor[2],ykoor[3]},
>   {xkoor[3],ykoor[3]},
>   {xkoor[4],ykoor[3]}}
>
> and have no idea how to get this. So I would be very happy to get any
> small hint...
>
> Thanks a lot,
>
> Harald
>
>
>

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305



  • Prev by Date: Re: Creating List
  • Next by Date: Re: Cool example with ContourPlot+EvaluationMonitor
  • Previous by thread: Re: Creating List
  • Next by thread: Re: Creating List