Skip to content

RF Touchstone / index / subset

Variable: subset() ​

subset: <T>(value, index, replacement?, defaultValue?) => T

Defined in: node_modules/mathjs/types/index.d.ts:7653

Get or set a subset of a matrix or string.

Type Parameters ​

T ​

T extends string | MathCollection<MathNumericType>

Parameters ​

value ​

T

An array, matrix, or string

index ​

Index

For each dimension, an index or list of indices to get or set.

replacement? ​

any

An array, matrix, or scalar. If provided, the subset is replaced with replacement. If not provided, the subset is returned

defaultValue? ​

any

Default value, filled in on new entries when the matrix is resized. If not provided, math.matrix elements will be left undefined. Default value: undefined.

Returns ​

T

Either the retrieved subset or the updated matrix