<!-- 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)
