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


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

Re: Creating a list of 1x2 element arrays without procedural

From Alexei Boulbitch <Alexei.Boulbitch@iee.lu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Creating a list of 1x2 element arrays without procedural
Date 2013-12-03 10:20 +0000
Message-ID <l7kb9i$459$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


Is there a way in Mathematica using built-in functions to create what the following procedural program does?

latlong = {}
Do[AppendTo[latlong, {i, j}] , {i, 30.0, 45.0,
   5.0}, {j, -270.0, -240.0, 10.0}];
latlong

Out:
{{30., -270.}, {30., -260.}, {30., -250.}, {30., -240.}, {35., \
-270.}, {35., -260.}, {35., -250.}, {35., -240.}, {40., -270.}, {40., \
-260.}, {40., -250.}, {40., -240.}, {45., -270.}, {45., -260.}, {45., \
-250.}, {45., -240.}}

Thanks!

-Tony

Hi, Tony,

It is:

latlong =
 Flatten[Table[{i, j}, {i, 30.0, 45.0, 5.0}, {j, -270.0, -240.0,
    10.0}], 1]

{{30., -270.}, {30., -260.}, {30., -250.}, {30., -240.}, {35., \
-270.}, {35., -260.}, {35., -250.}, {35., -240.}, {40., -270.}, {40., \
-260.}, {40., -250.}, {40., -240.}, {45., -270.}, {45., -260.}, {45., \
-250.}, {45., -240.}}

Have fun, Alexei


Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu


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


Thread

Re: Creating a list of 1x2 element arrays without procedural Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2013-12-03 10:20 +0000

csiph-web