How can I create an one dimensional array (a vector) evaluating a function of two variables? I know how to do it with one variable:
Array[f, n, {a, b}] generates a list using n values from a to b.
|
How can I create an one dimensional array (a vector) evaluating a function of two variables? I know how to do it with one variable:
|
||||
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.
|
You could use something akin to:
But I am not sure that this will be any more efficient that Flatten. |
|||||
|
Flattenit afterwards. – Szabolcs Feb 19 at 14:09f @@@ Tuples[{Range[a, b, c], Range[d, e, f]}]might be close to what you're looking for. It is, however, 10% slower than @Szabolcs' suggestion and might use more RAM. – whuber Feb 19 at 21:51