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


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

Simple list question

Started by"Ste[hen Gray" <stevebg@roadrunner.com>
First post2014-04-14 09:28 +0000
Last post2014-04-15 03:01 +0000
Articles 4 — 3 participants

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


Contents

  Simple list question "Ste[hen Gray" <stevebg@roadrunner.com> - 2014-04-14 09:28 +0000
    Re: Simple list question Kevin <kjm@KevinMcCann.com> - 2014-04-15 03:00 +0000
    Re: Simple list question Kevin <kjm@KevinMcCann.com> - 2014-04-15 03:00 +0000
    Re: Simple list question "Dr. Wolfgang Hintze" <weh@snafu.de> - 2014-04-15 03:01 +0000

#16804 — Simple list question

From"Ste[hen Gray" <stevebg@roadrunner.com>
Date2014-04-14 09:28 +0000
SubjectSimple list question
Message-ID<lig9nr$cft$1@smc.vnet.net>
pcin = 2;
pcex = 3;   (*pcin and pcex can have various small values *)

coin = Table[{10 RandomReal[], 10 RandomReal[]}, {pcin}]
coex = Table[{3 RandomReal[], 3 RandomReal[]}, {pcex}]
cobo = Append[coin, coex]


gives, typically,

{{0.288346, 3.57763}, {1.7335, 8.69666}}
{{0.179831, 1.35324}, {0.927483, 0.931586}, {1.76338, 2.45073}}
{{0.288346, 3.57763}, {1.7335,
   8.69666}, {{0.179831, 1.35324}, {0.927483, 0.931586}, {1.76338,
    2.45073}}}

What I want is a series of x,y coordinates with no extra nesting:

{{0.288346, 3.57763}, {1.7335,
   8.69666}, {0.179831, 1.35324}, {0.927483, 0.931586}, {1.76338,
    2.45073}}

I'm embarrassed to admit that I can't find how to do this.

Please email me. Thank you.

stevebg@roadrunner.com

[toc] | [next] | [standalone]


#16806

FromKevin <kjm@KevinMcCann.com>
Date2014-04-15 03:00 +0000
Message-ID<lii7c8$ii7$1@smc.vnet.net>
In reply to#16804
I sent the wrong line a moment ago. Try:

Partition[Flatten[cobo], 2]

kevin

On 4/14/2014 5:28 AM, Ste[hen Gray wrote:
> pcin = 2;
> pcex = 3;   (*pcin and pcex can have various small values *)
>
> coin = Table[{10 RandomReal[], 10 RandomReal[]}, {pcin}]
> coex = Table[{3 RandomReal[], 3 RandomReal[]}, {pcex}]
> cobo = Append[coin, coex]

[toc] | [prev] | [next] | [standalone]


#16807

FromKevin <kjm@KevinMcCann.com>
Date2014-04-15 03:00 +0000
Message-ID<lii7bk$ihu$1@smc.vnet.net>
In reply to#16804
Try Flatten on your final result.

Kevin

On 4/14/2014 5:28 AM, Ste[hen Gray wrote:
> pcin = 2;
> pcex = 3;   (*pcin and pcex can have various small values *)
>
> coin = Table[{10 RandomReal[], 10 RandomReal[]}, {pcin}]
> coex = Table[{3 RandomReal[], 3 RandomReal[]}, {pcex}]
> cobo = Append[coin, coex]
>
>
> gives, typically,
>
> {{0.288346, 3.57763}, {1.7335, 8.69666}}
> {{0.179831, 1.35324}, {0.927483, 0.931586}, {1.76338, 2.45073}}
> {{0.288346, 3.57763}, {1.7335,
>     8.69666}, {{0.179831, 1.35324}, {0.927483, 0.931586}, {1.76338,
>      2.45073}}}
>
> What I want is a series of x,y coordinates with no extra nesting:
>
> {{0.288346, 3.57763}, {1.7335,
>     8.69666}, {0.179831, 1.35324}, {0.927483, 0.931586}, {1.76338,
>      2.45073}}
>
> I'm embarrassed to admit that I can't find how to do this.
>
> Please email me. Thank you.
>
> stevebg@roadrunner.com
>

[toc] | [prev] | [next] | [standalone]


#16811

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2014-04-15 03:01 +0000
Message-ID<lii7eq$ij7$1@smc.vnet.net>
In reply to#16804
Use Join instead of Append:

Join[coin, coex]
{6.64424, 7.1156}, {7.50084, 9.96003}, {2.54776, 2.72347}, {1.69042, 
  2.56066}, {0.782634, 1.55627}}

Best regards,
Wolfgang



"Ste[hen Gray"  schrieb im Newsbeitrag news:lig9nr$cft$1@smc.vnet.net... 

pcin = 2;
pcex = 3;   (*pcin and pcex can have various small values *)

coin = Table[{10 RandomReal[], 10 RandomReal[]}, {pcin}]
coex = Table[{3 RandomReal[], 3 RandomReal[]}, {pcex}]
cobo = Append[coin, coex]


gives, typically,

{{0.288346, 3.57763}, {1.7335, 8.69666}}
{{0.179831, 1.35324}, {0.927483, 0.931586}, {1.76338, 2.45073}}
{{0.288346, 3.57763}, {1.7335,
   8.69666}, {{0.179831, 1.35324}, {0.927483, 0.931586}, {1.76338,
    2.45073}}}

What I want is a series of x,y coordinates with no extra nesting:

{{0.288346, 3.57763}, {1.7335,
   8.69666}, {0.179831, 1.35324}, {0.927483, 0.931586}, {1.76338,
    2.45073}}

I'm embarrassed to admit that I can't find how to do this.

Please email me. Thank you.

stevebg@roadrunner.com


[toc] | [prev] | [standalone]


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


csiph-web