Root mean square: rms

### 15.2.5 Root mean square: rms

The rms command finds the room mean square of a list of numbers X=[x1,x2,…,xn], which is defined by

RMS(X)= |
√
n
∑
k=1
| |xk|2
n
| .

- rms takes one argument:
  X, a list of real or complex numbers [x1,x2,…,xn].
- rms(X) returns the root mean square of X.

Examples.

- Input:
  rms([1,2,5,8,3,6,7,9,-1])
  Output:

  √ |
  30

- Input:
  rms([1,1-i,2+3i,5-2i])
  Output:

  3
  2
  | √ |
  5