I have two lists:
x = Range[1, 10, 1]
y = Range[2, 10, 2]
How can I produce a list consisting of the following elements (first element is the x value, second element the y value and third element some combination of it e.g. here the sum):
{
{x[[1]], y[[1]], x[[1]] + y[[1]]},
...
{x[[1]], y[[5]], x[[1]] + y[[5]]},
...
...
...
{x[[10]], y[[1]], x[[10]] + y[[1]]},
...
{x[[10]], y[[5]], x[[10]] + y[[5]]}
}
=
{
{1,2,3},
...
{1,10,11},
...
...
...
{10,2,12},
...
{10,10,20}
}

Tableand may beFlattenafterwards – Mauricio Fernández Nov 23 '16 at 13:41AppendTowithin aDoloop. Try it out :D – Mauricio Fernández Nov 23 '16 at 13:45