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


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

Re: Simple list question

Path csiph.com!usenet.pasdenom.info!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border4.nntp.dca.giganews.com!backlog4.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newspump.sol.net!post2.nntp.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail
From Bill Rowe <readnews@sbcglobal.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Simple list question
Date Tue, 15 Apr 2014 03:02:06 +0000 (UTC)
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <lii7fe$ije$1@smc.vnet.net> (permalink)
Lines 30
Organization Time-Warner Telecom
NNTP-Posting-Date 15 Apr 2014 03:08:09 GMT
NNTP-Posting-Host f9f24edc.news.twtelecom.net
X-Trace DXC=iWcFNd5JeLNP;Ll>D9?]MBC_A=>8kQj6M;[h;PUXBgbD27hNd_eWRHDEFiONJ7[GoFg@g87`^gjOI
X-Complaints-To abuse@twtelecom.net
X-Original-Bytes 1717
Xref csiph.com comp.soft-sys.math.mathematica:16810

Show key headers only | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | NextNext in thread | Find similar


Thread

Re: Simple list question Bill Rowe <readnews@sbcglobal.net> - 2014-04-15 03:02 +0000
  Speed of Join and Append.   Was Re: Simple list question Richard Fateman <fateman@cs.berkeley.edu> - 2014-04-16 07:40 +0000

csiph-web