matrixFromFunction
matrixFromFunction(size, fn)
matrixFromFunction(size, fn, format)
matrixFromFunction(size, fn, format, datatype)
matrixFromFunction(size, format, fn)
matrixFromFunction(size, format, datatype, fn)
Create a matrix by evaluating a generating function at each index.
Try it yourself:
$1 | f(I) = I[1] - I[2]
| |
$2 | matrixFromFunction([3,3], f)
| |
$3 | g(I) = I[1] - I[2] == 1 ? 4 : 0
| |
$4 | matrixFromFunction([100, 100], "sparse", g)
| |
$5 | matrixFromFunction([5], random)
|
See also:
All functions