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

MathGroup Archive 2014

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

Search the Archive

Re: Simple list question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg132593] Re: Simple list question
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Mon, 14 Apr 2014 23:01:59 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net

On 4/14/14 at 5:28 AM, stevebg at roadrunner.com (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]
>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]

<snip>

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

Instead of Append, use Join, i.e.

cobo = Join[coin, coex]

In fact, Append is something to generally avoid using
particularly for large arrays due to the computing resources
used. It will require more memory and is slower. Won't matter
for small arrays like this. But for large arrays, Append is very
much a problem and better replaced with other commands such as Join.




  • Prev by Date: Re: Simple list question
  • Next by Date: Re: Simple list question
  • Previous by thread: Re: Simple list question
  • Next by thread: Re: Simple list question