I want to get the difference of all elements of a list for example:
$L=\{1,2,3,4,5,6\}$ for any $i$ and $j$ $\in L$ return the differences,
for example for the first element $1$ we get the difference with the rest of elements $\{2,3,4,5,6\}$ we can use the Abs to get the absolute value of the differnce.
I used Differences but this gives the successive differences of elements in list.
Thank you.
Outer[Subtract,L,L]– Jens Jun 29 '16 at 18:20DistanceMatrix[]is better for this. – J. M.'s missing motivation Jun 29 '16 at 19:52DistanceMatrix[]is optimized for this particular calculation, then it's worth using for large lists in certain applications. There's a difference between solving a particular problem and learning general coding practice, and some people don't need the latter. – march Jun 29 '16 at 20:08DistanceMatrix- I guess it's too new (only introduced last year)... now that I looked for it it seems that this is a duplicate. – Jens Jun 29 '16 at 21:10