Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #16308
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Creating a list of 1x2 element arrays without procedural programming |
| Date | 2013-12-02 06:51 +0000 |
| Message-ID | <l7hal8$pcn$1@smc.vnet.net> (permalink) |
| References | <l7fckt$k44$1@smc.vnet.net> |
| Organization | Time-Warner Telecom |
Am Sonntag, 1. Dezember 2013 14:13:01 UTC+1 schrieb amannucci:
> 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
In[23]:= Flatten[
Table[{30 + 5*i, -270 + 10*j}, {i, 0, 3}, {j, 0, 3}], 1]
Out[23]= {{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}}
Regards,
Wolfgang
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Creating a list of 1x2 element arrays without procedural programming amannucci <Anthony.J.Mannucci@jpl.nasa.gov> - 2013-12-01 13:13 +0000 Re: Creating a list of 1x2 element arrays without procedural programming Roland Franzius <roland.franzius@uos.de> - 2013-12-02 06:46 +0000 Re: Creating a list of 1x2 element arrays without procedural programming "Nasser M. Abbasi" <nma@12000.org> - 2013-12-02 06:46 +0000 Re: Creating a list of 1x2 element arrays without procedural programming "Dr. Wolfgang Hintze" <weh@snafu.de> - 2013-12-02 06:51 +0000
csiph-web