Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9127
| From | Tomas Garza <tgarza10@msn.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Creating List |
| Date | 2012-03-18 07:54 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jk44ap$e30$1@smc.vnet.net> (permalink) |
| References | <201203170751.CAA05090@smc.vnet.net> |
Just to give a hint as to how to go about it, I define the xkcoor and ykcoor lists as a sequence of consecutive integers:
In[1]:= xkcoor=Table[j,{j,1,4}]Out[1]= {1,2,3,4}
In[2]:= ykcoor=Table[j,{j,1,4}]Out[2]= {1,2,3,4}
Then you can use
In[3]:= Partition[Flatten[Table[{xkcoor[[j]],ykcoor[[i]]},{i,1,3},{j,1,Length[xkcoor]}]],2]
Out[3]= {{1,1},{2,1},{3,1},{4,1},{1,2},{2,2},{3,2},{4,2},{1,3},{2,3},{3,3},{4,3}}
-Tomas
> Date: Sat, 17 Mar 2012 02:51:08 -0500
> From: hvdosten@gmail.com
> Subject: Creating List
> To: mathgroup@smc.vnet.net
>
> Hi out there,
>
>
> I have calculated some x- and y-values and want to combine them in a
> way that the x and y-values define coordinates. Well, I have:
>
> xkoor[i], {i, 1, iend} and
> ykoor[j], {j, 1, jend}
>
>
> To be able to continue I need this list:
>
> {{xkoor[1],ykoor[1]},
> {xkoor[2],ykoor[1]},
> {xkoor[3],ykoor[1]},
> {xkoor[4],ykoor[1]},
> {xkoor[1],ykoor[2]},
> {xkoor[2],ykoor[2]},
> {xkoor[3],ykoor[2]},
> {xkoor[4],ykoor[2]},
> {xkoor[1],ykoor[3]},
> {xkoor[2],ykoor[3]},
> {xkoor[3],ykoor[3]},
> {xkoor[4],ykoor[3]}}
>
> and have no idea how to get this. So I would be very happy to get any
> small hint...
>
> Thanks a lot,
>
> Harald
>
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Creating List Tomas Garza <tgarza10@msn.com> - 2012-03-18 07:54 +0000
csiph-web