UNPKG

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

45 lines (29 loc) 862 B
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> # Function mad 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. ## Syntax ```js math.mad(a, b, c, ...) math.mad(A) ``` ### Parameters Parameter | Type | Description --------- | ---- | ----------- `array` | Array &#124; Matrix | A single matrix or multiple scalar values. ### Returns Type | Description ---- | ----------- * | The median absolute deviation. ## Examples ```js math.mad(10, 20, 30) // returns 10 math.mad([1, 2, 3]) // returns 1 math.mad([[1, 2, 3], [4, 5, 6]]) // returns 1.5 ``` ## See also [median](median.md), [mean](mean.md), [std](std.md), [abs](abs.md)