Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Creating a list of 1x2 element arrays without
Replies: 4   Last Post: Dec 2, 2013 1:52 AM

 Messages: [ Previous | Next ]
 Sseziwa Mukasa Posts: 108 Registered: 8/26/07
Re: Creating a list of 1x2 element arrays without
Posted: Dec 2, 2013 1:43 AM

latlong=Flatten[Table[{i,j},{i,30,45,5},{j,-270,-240,10}],1]

On Sunday, December 1, 2013, amannucci wrote:

> 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
>
>

Date Subject Author
12/2/13 Sseziwa Mukasa
12/2/13 Itai Seggev
12/2/13 Bob Hanlon
12/2/13 Murray Eisenberg