mathjs
mathjs copied to clipboard
range() returning dense matrix?
math.range(0, 10, 1)
Should return an array, but instead it returns a matrix? That's very strange behaviour; Am I missing something?
The docs say it can return an array or a matrix. I assumed that if I gave it matrix inputs (to make a mesh for instance), I'd get a matrix output; But instead with simple number inputs we get a matrix instead.
https://mathjs.org/docs/reference/functions/range.html
This gives the expected result:
math.range(0, 10, 1).toArray()
You can configure whether the function returns a Matrix or an Array using the configuration option matrix: 'Array', see docs https://mathjs.org/docs/core/configuration.html