TMtx.RMS Method

Double RMS

Root mean square (RMS).

Returns: Double

Remarks:

Calculate the root mean square value for all calling object elements in-place. The root mean square (RMS) is defined by the equation:

RMS=1Length1k=0Length1V[k]2\text{RMS}=\sqrt{\frac{1}{\text{Length}-1}\sum _{k=0} ^{\text{Length}-1} V[k] ^2 }
Examples
Matrix a = new Matrix();
a.SetIt(2, 2, false, new double[] { 1.0, 2.0, 3.0, 4.0 });
double result = a.RMS();
if (Math.Abs(result - 2.73861278752583) > 1e-10)
    throw new Exception("Matrix.RMS: expected 2.73861278752583, got " + result);
Matrix a;
double c;
a.SetIt(1,4,false,new double[] {1,2,3,4});
c = a.RMS;

Indexed: Double RMS(Int32 Index, Int32 Len)

Calculate the RMS for calling object elements [Index]..[Index+Len-1] in-place.

#NameTypeDescription
1IndexInt32start index
2LenInt32element count

Returns: Double

Remarks:

An exception is raised if array borders are overrun.