Consider a function F[x;y]
that generates a table. I also have two lists; xList:[x1;x2;x3]
and yList:[y1;y2;y3]
. What is the best way to do a simple comma join of F[x1;y1],F[x1;y2],F[x1;y3],F[x2;y1],...,
thereby producing one large table?
相关问题
- Keeping track of variable instances
- How to get the maximum of more than 2 numbers in V
- F#: Storing and mapping a list of functions
- VBA Self-Function returns #VALUE! Error on cell, w
- How does colnames function assign new column names
相关文章
- Accessing an array element when returning from a f
- Equivalent to window.setTimeout() for C++
- How can I write-protect the Matlab language?
- Java Equivalent to iif function
- How do you create a formula that has diminishing r
- Add multiplication signs (*) between coefficients
- Is it legal to take the address of a function para
- Accessing variables in a function within a functio
You have asked for the cross product of your argument lists, so the correct answer is
Depending on what you are doing, you might want to look into having your function operate on the entire list of x and the entire list of y and return a table, rather than on each pair and then return a list of tables which has to get razed. The performance impact can be considerable, for example see below
Setup our example
Demonstrate F[x1;y1]
Use the multi-valent apply operator together with each' to apply to each pair of arguments.
Another way to achieve it using
each-both
: