mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
56 lines (37 loc) • 1.1 kB
Markdown
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
Create an index. An Index can store ranges having start, step, and end
for multiple dimensions.
Matrix.get, Matrix.set, and math.subset accept an Index as input.
```js
math.index(range1, range2, ...)
```
- A number
- A string for getting/setting an object property
- An instance of `Range`
- A one-dimensional Array or a Matrix with numbers
Parameter | Type | Description
--------- | ---- | -----------
`ranges` | ...* | Zero or more ranges or numbers.
Type | Description
---- | -----------
Index | Returns the created index
```js
const b = [1, 2, 3, 4, 5]
math.subset(b, math.index([1, 2, 3])) // returns [2, 3, 4]
const a = math.matrix([[1, 2], [3, 4]])
a.subset(math.index(0, 1)) // returns 2
```
[ ](bignumber.md),
[ ](boolean.md),
[ ](complex.md),
[ ](matrix.md),
[ ](number.md),
[ ](string.md),
[ ](unit.md)