Hi all, I am a student who is undertaking the project EOG and I’m stuck because I’m new in Mathematica.
I need a code that divide two vectors such as
x = {1,2,3, ...}; y = {a, b, c, ...}
in a list such that
list = {{1, a}, {2, b}, {3, c}, ...}
Can someone help me?
Thanks in advance by your attention
What have you tried? Did you even try to search documentation? For example:
x = {1, 2, 3}; y = {a, b, c};
Transpose[{x, y}]
Thread[{x, y}]
You should really start from minimal effort to learn docs and for example to see this:
fkampas
(Frank Kampas)
4
In[1]:= Thread[{{1, 2, 3}, {a, b, c}}]
Out[1]= {{1, a}, {2, b}, {3, c}}
murray
(Murray Eisenberg)
5
Just for variety, another way:
Partition[Riffle[Range[3], {a, b, c}], 2]
P.S. Please use a more informative question topic than “I need help with mathematica”. For example: “How interweave two lists in Mathematica?”