Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9116 > unrolled thread

Re: Creating List

Started byBob Hanlon <hanlonr357@gmail.com>
First post2012-03-18 07:48 +0000
Last post2012-03-18 07:48 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Creating List Bob Hanlon <hanlonr357@gmail.com> - 2012-03-18 07:48 +0000

#9116 — Re: Creating List

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-03-18 07:48 +0000
SubjectRe: Creating List
Message-ID<jk4408$e09$1@smc.vnet.net>
x = Array[xkoor, 4];

y = Array[ykoor, 3];

Flatten[Outer[{#2, #1} &, y, x], 1]

{{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]}}


Bob Hanlon


On Sat, Mar 17, 2012 at 3:51 AM, Harry <hvdosten@gmail.com> 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
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web