Groups | Search | Server Info | Login | Register
Groups > comp.soft-sys.math.mathematica > #16810
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Simple list question |
| Date | 2014-04-15 03:02 +0000 |
| Message-ID | <lii7fe$ije$1@smc.vnet.net> (permalink) |
| Organization | Time-Warner Telecom |
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 | Next — Next in thread | Find similar
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