mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices.
21 lines (20 loc) • 488 B
JavaScript
module.exports = {
'name': 'eye',
'category': 'Matrix',
'syntax': [
'eye(n)',
'eye(m, n)',
'eye([m, n])',
'eye'
],
'description': 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.',
'examples': [
'eye(3)',
'eye(3, 5)',
'a = [1, 2, 3; 4, 5, 6]',
'eye(size(a))'
],
'seealso': [
'concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros'
]
};