The dimension along which the callback is applied
The callback function that is applied. This Function should take an array or 1-d matrix as an input and return a number.
The residual matrix with the function applied over some dimension.
Calculate the absolute value of a number. For matrices, the function is evaluated element wise.
Calculate the inverse cosine of a value. For matrices, the function is evaluated element wise.
Calculate the hyperbolic arccos of a value, defined as acosh(x) = ln(sqrt(x^2 - 1) + x). For matrices, the function is evaluated element wise.
Calculate the inverse cotangent of a value. For matrices, the function is evaluated element wise.
Calculate the inverse hyperbolic tangent of a value, defined as acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2. For matrices, the function is evaluated element wise.
Calculate the inverse cosecant of a value. For matrices, the function is evaluated element wise.
Calculate the inverse hyperbolic cosecant of a value, defined as acsch(x) = ln(1/x + sqrt(1/x^2 + 1)). For matrices, the function is evaluated element wise.
Add two values, x + y. For matrices, the function is evaluated element wise.
Second value to add
Logical and. Test whether two values are both defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise.
Second value to and
Compute the argument of a complex value. For a complex number a + bi, the argument is computed as atan2(b, a). For matrices, the function is evaluated element wise.
Calculate the inverse secant of a value. For matrices, the function is evaluated element wise.
Calculate the hyperbolic arcsecant of a value, defined as asech(x) = ln(sqrt(1/x^2 - 1) + 1/x). For matrices, the function is evaluated element wise.
Calculate the inverse sine of a value. For matrices, the function is evaluated element wise.
Calculate the hyperbolic arcsine of a value, defined as asinh(x) = ln(x + sqrt(x^2 + 1)). For matrices, the function is evaluated element wise.
Calculate the inverse tangent of a value. For matrices, the function is evaluated element wise.
Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the computed angle can be determined. For matrices, the function is evaluated element wise.
Calculate the hyperbolic arctangent of a value, defined as atanh(x) = ln((1 + x)/(1 - x)) / 2. For matrices, the function is evaluated element wise.
The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. The following condition must be enforced: n
= 0
Bernoulli number at this index
Create a bigint, which can store integers with arbitrary precision. When a matrix is provided, all elements will be converted to bigint.
Create a BigNumber, which can store numbers with arbitrary precision. When a matrix is provided, all elements will be converted to BigNumber.
Bitwise AND two values, x & y. For matrices, the function is evaluated element wise.
Second value to and
Bitwise NOT value, ~x. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base.
Bitwise OR two values, x | y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the lowest print base.
Second value to or
Bitwise XOR two values, x ^ y. For matrices, the function is evaluated element wise.
Second value to xor
Create a boolean or convert a string or number to a boolean. In case of a number, true is returned for non-zero numbers, and false in case of zero. Strings can be 'true' or 'false', or can contain a number. When value is a matrix, all elements will be converted to boolean.
The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0
Calculate the cubic root of a value. For matrices, the function is evaluated element wise.
OptionalallRoots: booleanOptional, false by default. Only applicable when x is a number or complex number. If true, all complex roots are returned, if false (default) the principal root is returned.
Round a value towards plus infinity If x is complex, both real and imaginary part are rounded towards plus infinity. For matrices, the function is evaluated element wise.
Optionaln: number | BigNumber | MathCollection<MathNumericType>Number of decimals Default value: 0.
Clone an object.
Compute the number of ways of picking k unordered outcomes from n possibilities. Combinations only takes integer arguments. The following condition must be enforced: k <= n.
Number of objects in the subset
Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. x and y are considered equal when the relative difference between x and y is smaller than the configured relTol and absTol. The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise.
Second value to compare
Compare two values of any type in a deterministic, natural way. For numeric values, the function works the same as math.compare. For types of values that can’t be compared mathematically, the function compares in a natural way.
Second value to compare
Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y. For matrices, the function is evaluated element wise.
Second string to compare
Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.
Create a complex value or convert a value to a complex value.
Optionalim: numberArgument specifying the imaginary part of the complex number
The composition counts of n into k parts. Composition only takes integer arguments. The following condition must be enforced: k <= n.
Number of objects in the subset
Concatenate two or more matrices. dim: number is a zero-based dimension over which to concatenate the matrices. By default the last dimension of the matrices.
Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate of x is a - bi. For matrices, the function is evaluated element wise.
Calculate the cosine of a value. For matrices, the function is evaluated element wise.
Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2
Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). For matrices, the function is evaluated element wise.
Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x). For matrices, the function is evaluated element wise.
Count the number of elements of a matrix, array or string.
Create a user-defined unit and register it with the Unit type.
Optionaldefinition: string | Unit | UnitDefinitionDefinition of the unit in terms of existing units. For example, ‘0.514444444 m / s’.
Optionaloptions: CreateUnitOptions(optional) An object containing any of the following properties:- prefixes {string} “none”, “short”, “long”, “binary_short”, or “binary_long”. The default is “none”.- aliases {Array} Array of strings. Example: [‘knots’, ‘kt’, ‘kts’]- offset {Numeric} An offset to apply when converting from the unit. For example, the offset for celsius is 273.15. Default is 0.
Create a user-defined unit and register it with the Unit type.
Optionaloptions: CreateUnitOptions(optional) An object containing any of the following properties:- prefixes {string} “none”, “short”, “long”, “binary_short”, or “binary_long”. The default is “none”.- aliases {Array} Array of strings. Example: [‘knots’, ‘kt’, ‘kts’]- offset {Numeric} An offset to apply when converting from the unit. For example, the offset for celsius is 273.15. Default is 0.
Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] and B =[b1, b2, b3] is defined as: cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1
Second vector
Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For matrices, the function is evaluated element wise.
Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x). For matrices, the function is evaluated element wise.
Transpose and complex conjugate a matrix. All values of the matrix are reflected over its main diagonal and then the complex conjugate is taken. This is equivalent to complex conjugation for scalars and vectors.
Compute the cube of a value, x * x * x. For matrices, the function is evaluated element wise.
Test element wise whether two matrices are equal. The function accepts both matrices and scalar values.
Second amtrix to compare
The variable over which to differentiate
Optionaloptions: { simplify: boolean }There is one option available, simplify, which is true by default. When false, output will not be simplified.
Calculate the determinant of a matrix.
Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with vector x on the diagonal will be returned. When x is a two dimensional matrix, the matrixes kth diagonal will be returned as vector. When k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.
Optionalformat: stringThe matrix storage format. Default value: 'dense'.
Optionalformat: stringCalculate the difference between adjacent elements of the chained matrix or array.
Optionaldim: number | BigNumberThe dimension to apply the difference on.
Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c)
Coordinates of the second point
Divide two values, x / y. To divide matrices, x is multiplied with the inverse of y: x * inv(y).
Denominator
Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as: dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn
Second vector
Divide two matrices element wise. The function accepts both matrices and scalar values.
Denominator
Multiply two matrices element wise. The function accepts both matrices and scalar values.
Right hand value
Calculates the power of x to y element wise.
The exponent
Test whether two values are equal.
The function tests whether the relative difference between x and y is smaller than the configured relTol and absTol. The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise. In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. Values null and undefined are compared strictly, thus null is only equal to null and nothing else, and undefined is only equal to undefined and nothing else.
Second value to compare
Check equality of two strings. Comparison is case sensitive. For matrices, the function is evaluated element wise.
Second string to compare
Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x.
Evaluate an expression.
Optionalscope: MathScope<any>Scope to read/write variables
Optionalscope: MathScope<any>Calculate the exponent of a value. For matrices, the function is evaluated element wise.
Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation. The exponential is calculated using the Padé approximant with scaling and squaring; see “Nineteen Dubious Ways to Compute the Exponential of a Matrix,” by Moler and Van Loan.
Calculate the value of subtracting 1 from the exponential value. For matrices, the function is evaluated element wise.
Compute the factorial of a value Factorial only supports an integer value as argument. For matrices, the function is evaluated element wise.
Filter the items in an array or one dimensional matrix.
Round a value towards zero. For matrices, the function is evaluated element wise.
Optionaln: number | BigNumber | MathCollection<MathNumericType>Number of decimals Default value: 0.
Flatten a multi dimensional matrix into a single dimensional matrix.
Round a value towards minus infinity. For matrices, the function is evaluated element wise.
Optionaln: number | BigNumber | MathCollection<MathNumericType>Number of decimals Default value: 0.
Iterate over all elements of a matrix/array, and executes the given callback function.
Format a value of any type into a string.
Optionaloptions: number | FormatOptions | ((item: any) => string)An object with formatting options.
Optionalcallback: (value: any) => stringA custom formatting function, invoked for all numeric elements in value, for example all elements of a matrix, or the real and imaginary parts of a complex number. This callback can be used to override the built-in numeric notation with any type of formatting. Function callback is called with value as parameter and must return a string.
Create a fraction convert a value to a fraction.
Optionaldenominator: numberArgument specifying the denominator of the fraction
Calculates the frequency response of a filter given its numerator and denominator coefficients.
Optionalw: number | TCompute the gamma function of a value using Lanczos approximation for small values, and an extended Stirling approximation for large values. For matrices, the function is evaluated element wise.
Calculate the greatest common divisor for two or more values or arrays. For matrices, the function is evaluated element wise.
Get the data type in a collection
Retrieve help on a function or data type. Help files are retrieved from the documentation in math.expression.docs.
Calculate the hypotenuse of a list with values. The hypotenuse is defined as: hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) For matrix input, the hypotenuse is calculated for all values in the matrix.
Create a 2-dimensional identity matrix with size m x n or n x n. The matrix has ones on the diagonal and zeros elsewhere.
Optionalformat: stringThe Matrix storage format
The y dimension for the matrix
Optionalformat: stringThe Matrix storage format
Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. For matrices, the function is evaluated element wise.
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.
Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions return null if the lines do not meet. Note: Fill the plane coefficients as x + y + z = c and not as x + y + z + c = 0.
Co-ordinates of second end-point of first line
Co-ordinates of first end-point of second line OR Coefficients of the plane's equation
Optionalz: MathCollection<MathNumericType>Co-ordinates of second end-point of second line OR null if the calculation is for line and plane
Calculate the inverse of a square matrix.
Test whether a value is bounded, works on entire collection at once
Test whether a value is finite, works elementwise on collections
Test whether a value is an integer number. The function supports number, BigNumber, and Fraction. The function is evaluated element-wise in case of Array or Matrix input.
Test whether a value is NaN (not a number). The function supports types number, BigNumber, Fraction, Unit and Complex. The function is evaluated element-wise in case of Array or Matrix input.
Test whether a value is negative: smaller than zero. The function supports types number, BigNumber, Fraction, and Unit. The function is evaluated element-wise in case of Array or Matrix input.
Test whether a value is a numeric value. The function is evaluated element-wise in case of Array or Matrix input.
Test whether a value is positive: larger than zero. The function supports types number, BigNumber, Fraction, and Unit. The function is evaluated element-wise in case of Array or Matrix input.
Test whether a value is prime: has no divisors other than itself and one. The function supports type number, bignumber. The function is evaluated element-wise in case of Array or Matrix input.
Test whether a value is zero. The function can check for zero for types number, BigNumber, Fraction, Complex, and Unit. The function is evaluated element-wise in case of Array or Matrix input.
Calculate the Kullback-Leibler (KL) divergence between two distributions
Second vector
Calculate the Kronecker product of two matrices or vectors
Second vector
Test whether value x is larger than y. The function returns true when x is larger than y and the relative difference between x and y is larger than the configured relTol and absTol. The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise.
Second value to compare
Test whether value x is larger or equal to y. The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured relTol and absTol. The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise.
Second value to vcompare
Calculate the least common multiple for two or more values or arrays. lcm is defined as: lcm(a, b) = abs(a * b) / gcd(a, b) For matrices, the function is evaluated element wise.
An integer number
Gives the number of “leaf nodes” in the parse tree of the given
expression. A leaf node is one that has no subexpressions, essentially
either a symbol or a constant. Note that 5! has just one leaf, the 5;
the unary factorial operator does not add a leaf. On the other hand,
function symbols do add leaves, so sin(x)/cos(x) has four leaves.
Bitwise left logical shift of a value x by y number of bits, x << y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base.
Amount of shifts
Calculate the logarithm of a value. For matrices, the function is evaluated element wise.
Optionalbase: number | BigNumber | ComplexOptional base for the logarithm. If not provided, the natural logarithm of x is calculated. Default value: e.
Calculate the 10-base of a value. This is the same as calculating log(x, 10). For matrices, the function is evaluated element wise.
Calculate the logarithm of a value+1. For matrices, the function is evaluated element wise.
Optionalbase: number | BigNumber | ComplexOptionalbase: number | BigNumber | ComplexOptionalbase: number | BigNumber | ComplexOptionalbase: number | BigNumber | ComplexOptionalbase: number | BigNumber | ComplexCalculate the 2-base of a value. This is the same as calculating log(x, 2). For matrices, the function is evaluated element wise.
Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix.
A column vector with the b values
Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) and a row permutation vector p where A[p,:] = L * U
Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.
Column Vector
Optionalorder: numberThe Symbolic Ordering and Analysis order, see slu for details. Matrix must be a SparseMatrix
Optionalthreshold: numberPartial pivoting threshold (1 for partial pivoting), see slu for details. Matrix must be a SparseMatrix.
Optionalorder: numberOptionalthreshold: numberSolves the Continuous-time Lyapunov equation AP+PA'=Q for P, where Q is a positive semidefinite matrix. https://en.wikipedia.org/wiki/Lyapunov_equation
Matrix Q
Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q
Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.
Iterate over all elements of a matrix/array, and executes the given callback function.
The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix/array being traversed.
Apply a function that maps an array to a scalar along a given axis of the matrix or array. Returns a new matrix or array with one less dimension than the input.
The dimension along which the callback is applied
The callback function that is applied. This Function should take an array or 1-d matrix as an input and return a number.
The residual matrix with the function applied over some dimension.
Create a Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility functions to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. Supported storage formats are 'dense' and 'sparse'.
Optionalformat: "sparse" | "dense"OptionaldataType: stringCompute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based.
Optionaldim: numberThe maximum over the selected dimension
Optionaldim: numberCompute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based.
Optionaldim: numberThe mean over the selected dimension
Optionaldim: numberCompute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned. Supported types of values are: Number, BigNumber, Unit In case of a (multi dimensional) array or matrix, the median of all elements will be calculated.
Optionaldim: numberOptionaldim: numberCompute the minimum value of a matrix or a list of values. In case of a multi dimensional array, the minimum of the flattened array will be calculated. When dim is provided, the minimum over the selected dimension will be calculated. Parameter dim is zero-based.
Optionaldim: numberCalculates the modulus, the remainder of an integer division. For matrices, the function is evaluated element wise. The modulus is defined as: x - y * floor(x / y)
Divisor
Computes the mode of a set of numbers or a list with values(numbers or characters). If there are more than one modes, it returns a list of those values.
Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from n possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai <= 0
Multiply two values, x * y. The result is squeezed. For matrices, the matrix product is calculated.
The second value to multiply
Calculate the norm of a number, vector or matrix. The second parameter p is optional. If not provided, it defaults to 2.
Optionalp: string | number | BigNumberVector space. Supported numbers include Infinity and -Infinity. Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm) Default value: 2.
Logical not. Flips boolean value of a given parameter. For matrices, the function is evaluated element wise.
Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation x^root = A For matrices, the function is evaluated element wise.
Optionalroot: number | BigNumberThe root. Default value: 2.
Optionalroot: number | BigNumberCalculate all nth roots of a value.
Optionaln: numberWhich root to take. Default value: 2.
Create a number or convert a string, boolean, or unit to a number. When value is a matrix, all elements will be converted to number.
OptionalvaluelessUnit: string | UnitA valueless unit, used to convert a unit to a number
OptionalvaluelessUnit: string | UnitConvert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.
The desired numeric output type
Create a matrix filled with ones. The created matrix can have one or multiple dimensions.
Optionalformat: stringThe matrix storage format
Logical or. Test if at least one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise.
Second value to or
Optionaloptions: anyAvailable options: nodes - a set of custome nodes
Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate();
Optionaloptions: anyAvailable options: nodes - a set of custome nodes
Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.
The kth smallest value to be retrieved; zero-based index
Optionalcompare: "desc" | "asc" | ((a: any, b: any) => number)An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'.
Compute the number of ways of obtaining an ordered subset of k elements from a set of n elements. Permutations only takes integer arguments. The following condition must be enforced: k <= n.
Optionalk: number | BigNumberThe number of objects in the subset
Random pick a value from a one dimensional array. Array element is picked using a random function with uniform distribution.
Calculates the power of x to y, x ^ y. Matrix exponentiation is supported for square matrices x, and positive integer exponents y.
The exponent
Interpolate values into a string template.
An object containing variables which will be filled in in the template.
Optionalprecision: numberNumber of digits to format numbers. If not provided, the value will not be rounded.
Optionaloptions: number | objectFormatting options, or the number of digits to format numbers. See function math.format for a description of all options.
Compute the product of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated.
Calculate the Matrix QR decomposition. Matrix A is decomposed in two matrices (Q, R) where Q is an orthogonal matrix and R is an upper triangular matrix.
Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.
Optionalsorted: boolean=false is data sorted in ascending order
Return a random number larger or equal to min and smaller than max using a uniform distribution.
Optionalmax: numberMaximum boundary for the random value, excluded
Optionalmin: numberOptionalmax: numberReturn a random integer number larger or equal to min and smaller than max using a uniform distribution.
Optionalmax: numberMaximum boundary for the random value, excluded
Optionalmax: numberCreate an array from a range. By default, the range end is excluded. This can be customized by providing an extra parameter includeEnd.
OptionalincludeEnd: booleanOptionalincludeEnd: booleanTransform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.
Optionaloptional: boolean | objectscope of expression or true for already evaluated rational expression at input
Optionaldetailed: booleanoptional True if return an object, false if return expression node (default)
Get the real part of a complex number. For a complex number a + bi, the function returns a. For matrices, the function is evaluated element wise.
Reshape a multi dimensional array to fit the specified dimensions
One dimensional array with integral sizes for each dimension
Resize a matrix
One dimensional array with numbers
OptionaldefaultValue: string | numberZero by default, except in case of a string, in that case defaultValue = ' ' Default value: 0.
Replaces variable nodes with their scoped values
Optionalscope: MathScope<any>Scope to read/write variables
Optionalscope: MathScope<any>Bitwise right arithmetic shift of a value x by y number of bits, x >> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base.
Amount of shifts
Bitwise right logical shift of value x by y number of bits, x >>> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base.
Amount of shifts
Round a value towards the nearest integer. For matrices, the function is evaluated element wise.
Optionaln: number | BigNumber | MathCollection<MathNumericType>Number of decimals Default value: 0.
Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal and T is upper quasi-triangular. https://en.wikipedia.org/wiki/Schur_decomposition
Object containing both matrix U and T of the Schur Decomposition A=UTU'
Calculate the secant of a value, defined as sec(x) = 1/cos(x). For matrices, the function is evaluated element wise.
Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x). For matrices, the function is evaluated element wise.
Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.
A (multi)set
Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation
A (multi)set
Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.
Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.
A (multi)set
Check whether a (multi)set is a subset of another (multi)set. (Every element of set1 is the element of set2.) Multi-dimension arrays will be converted to single-dimension arrays before the operation.
A (multi)set
Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.
A multiset
Create the powerset of a (multi)set. (The powerset contains very possible subsets of a (multi)set.) A multi-dimension array will be converted to a single-dimension array before the operation.
Count the number of elements of a (multi)set. When a second parameter is ‘true’, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.
Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.
A (multi)set
Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.
A (multi)set
Compute the sign of a value. The sign of a value x is: 1 when x > 1 -1 when x < 0 0 when x == 0 For matrices, the function is evaluated element wise.
The sign of x
Simplify an expression tree.
Optionalrules: SimplifyRule[]A list of rules are applied to an expression, repeating over the list until no further changes are made. It’s possible to pass a custom set of rules to the function as second argument. A rule can be specified as an object, string, or function.
Optionalscope: object | Map<string, MathType>Scope to variables
Optionaloptions: SimplifyOptionsOptions to configure the behavior of simplify
Optionaloptions: SimplifyOptionsOptionaloptions: SimplifyOptionsCalculate the sine of a value. For matrices, the function is evaluated element wise.
Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)). For matrices, the function is evaluated element wise.
Calculate the size of a matrix or scalar.
Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U
The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic ordering and analysis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. This is appropriate for LU factorization of non-symmetric matrices. 3 - Symbolic ordering and analysis is performed on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with more than 10*sqr(columns) entries.
Partial pivoting threshold (1 for partial pivoting)
Test whether value x is smaller than y. The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured relTol and absTol. The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise.
Second value to vcompare
Test whether value x is smaller or equal to y. The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured relTol and absTol. The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise.
Second value to compare
Sort the items in a matrix
An optional _comparator function or name. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: ‘asc’
Create a Sparse Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility functions to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix.
OptionaldataType: stringSparse Matrix data type
Split a unit in an array of units whose sum is equal to the original unit.
An array of strings or valueless units
Calculate the square root of a value. For matrices, the function is evaluated element wise.
Calculate the principal square root of a square matrix. The principal square root matrix X of another matrix A is such that X * X = A.
Compute the square of a value, x * x. For matrices, the function is evaluated element wise.
Squeeze a matrix, remove inner and outer singleton dimensions from a matrix.
Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the variance: std(A) = sqrt(variance(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will be calculated. Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following values: 'unbiased' (default) The sum of squared errors is divided by (n - 1) 'uncorrected' The sum of squared errors is divided by n 'biased' The sum of squared errors is divided by (n + 1)
Optionaldim: numberA dimension to compute standard deviation.
Optionalnormalization: "unbiased" | "uncorrected" | "biased"Determines how to normalize the variance. Choose ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. Default value: ‘unbiased’.
The standard deviation
Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the variance: std(A) = sqrt(variance(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will be calculated. Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following values: 'unbiased' (default) The sum of squared errors is divided by (n - 1) 'uncorrected' The sum of squared errors is divided by n 'biased' The sum of squared errors is divided by (n + 1)
Optionaldimension: numberOptionalnormalization: "unbiased" | "uncorrected" | "biased"Determines how to normalize the variance. Choose ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. Default value: ‘unbiased’.
The standard deviation
Compute the sum of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated.
The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1
Number of objects in the subset
Create a string or convert any object into a string. Elements of Arrays and Matrices are processed element wise.
Get or set a subset of a matrix or string.
For each dimension, an index or list of indices to get or set
Optionalreplacement: anyAn array, matrix, or scalar. If provided, the subset is replaced with replacement. If not provided, the subset is returned
OptionaldefaultValue: anyDefault value, filled in on new entries when the matrix is resized. If not provided, math.matrix elements will be left undefined. Default value: undefined.
Subtract two values, x - y. For matrices, the function is evaluated element wise.
Value to subtract from x
Compute the sum of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated.
Determines if two expressions are symbolically equal, i.e. one is the result of valid algebraic manipulations on the other.
The second expression to compare
Optionaloptions: SimplifyOptionsOptional option object, passed to simplify
Returns true if a valid manipulation making the expressions equal is found.
Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). For matrices, the function is evaluated element wise.
Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1). For matrices, the function is evaluated element wise.
Change the unit of a value. For matrices, the function is evaluated element wise.
New unit. Can be a string like "cm" or a unit without value.
Converts a unit to the most appropriate display unit. When no preferred units are provided, the function automatically find the best prefix. When preferred units are provided, it converts to the unit that gives a value closest to 1.
Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.
Transpose a matrix. All values of the matrix are reflected over its main diagonal. Only two dimensional matrices are supported.
Inverse the sign of a value, apply a unary minus operation. For matrices, the function is evaluated element wise. Boolean values and strings will be converted to a number. For complex numbers, both real and complex value are inverted.
Unary plus operation. Boolean values and strings will be converted to a number, numeric values will be returned as is. For matrices, the function is evaluated element wise.
Test whether two values are unequal. The function tests whether the relative difference between x and y is larger than the configured relTol and absTol. The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise. In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with everything except undefined.
Second value to vcompare
Create a unit. Depending on the passed arguments, the function will create and return a new math.type.Unit object. When a matrix is provided, all elements will be converted to units.
Optionalunit: stringThe unit to be created
Optionalunit: stringSolves the linear equation system by backward substitution. Matrix must be an upper triangular matrix. U * x = b
A column vector with the b values
Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all elements will be calculated. Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following values: 'unbiased' (default) The sum of squared errors is divided by (n - 1) 'uncorrected' The sum of squared errors is divided by n 'biased' The sum of squared errors is divided by (n +
The variance
Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all elements will be calculated. Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following values: 'unbiased' (default) The sum of squared errors is divided by (n - 1) 'uncorrected' The sum of squared errors is divided by n 'biased' The sum of squared errors is divided by (n +
Optionaldimension: numberOptionalnormalization: "unbiased" | "uncorrected" | "biased"normalization Determines how to normalize the variance. Choose ‘unbiased’ (default), ‘uncorrected’, or ‘biased’. Default value: ‘unbiased’.
The variance
Calculate the extended greatest common divisor for two values. See http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm.
An integer number
Logical xor. Test whether one and only one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise.
Second value to xor
Create a matrix filled with zeros. The created matrix can have one or multiple dimensions.
Optionalformat: stringThe matrix storage format
A matrix filled with zeros
Compute the Riemann Zeta function of a value using an infinite series and Riemann's Functional equation.
Compute the transfer function of a zero-pole-gain model.
Optionalk: number
Apply a function that maps an array to a scalar along a given axis of the matrix or array. Returns a new matrix or array with one less dimension than the input.