FUNCTION REFERENCE

rms

Root-mean-square level.

Root-mean-square level.

Syntax

y = rms(x)

Syntax

y = rms(x, dim)

Syntax

y = rms(x, vecdim)

Syntax

y = rms(x, 'all')

Syntax

y = rms(..., nanflag)

The square root of the mean of abs(x).^2 along dim (default: the first dimension whose size is not 1), over the dimensions in vecdim, or over every element with 'all'. 'includenan' (default) gives NaN for a vector holding a NaN; 'omitnan' leaves NaN values out. Complex input uses the magnitude. rms([]) is NaN. x is double, single, logical or char: single input gives single results (computed in double, then rounded), and integer input is an error.

Example

rms([3 4])   % 3.5355

Example

rms([1 2; 3 4], 2)   % [1.5811; 3.5355]

Example

rms([1 NaN 3], 'omitnan')   % 2.2361

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.