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
16 lines (15 loc) • 422 B
JavaScript
module.exports = {
'name': 'trace',
'category': 'Matrix',
'syntax': [
'trace(A)'
],
'description': 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.',
'examples': [
'A = [1, 2, 3; -1, 2, 3; 2, 0, 3]',
'trace(A)'
],
'seealso': [
'concat', 'det', 'diag', 'eye', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros'
]
};