Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.soft-sys.math.mathematica > #16809

Re: Simple list question

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Simple list question
Date 2014-04-15 03:01 +0000
Message-ID <lii7e5$ij0$1@smc.vnet.net> (permalink)
References <20140414092810.CE3046A50@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


Use Join rather than Append


pcin = 2;
pcex = 3;

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


cobo = Join[coin, coex];


Dimensions[cobo]


{5, 2}



Bob Hanlon




On Mon, Apr 14, 2014 at 5:28 AM, Ste[hen Gray <stevebg@roadrunner.com>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
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar


Thread

Re: Simple list question Bob Hanlon <hanlonr357@gmail.com> - 2014-04-15 03:01 +0000

csiph-web