(To be removed) Root mean square of vector elements
The dsp.RMS
object computes the root mean square (RMS)
value.
The dsp.RMS
System
object™ will be removed in a future release. To compute the RMS, use the rms
function.
To compute the running RMS in MATLAB®, use the dsp.MovingRMS
object. For more information, see
Compatibility Considerations.
To compute the RMS value of your input:
Create the dsp.RMS
object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects? (MATLAB).
returns a System
object, rms
= dsp.RMSrms
, that computes the root mean square (RMS) of an
input or a sequence of inputs over the specified Dimension
.
returns an RMS System
object, rms
= dsp.RMS(Name,Value
)rms
, with each specified property set to the specified
value.
To use an object function, specify the
System
object as the first input argument. For
example, to release system resources of a System
object named obj
, use
this syntax:
release(obj)
Note: If you are using R2016a or an
earlier release, replace each call to the object with the equivalent step
syntax. For example, obj(x)
becomes
step(obj,x)
.
Compute the RMS value of a matrix with the Dimension
property set to
'All'
.
in2 = magic(4);
rms2d = dsp.RMS;
rms2d.Dimension = 'All';
y_rms2 = rms2d(in2)
y_rms2 = 9.6695
The output is equivalent to reshaping the 4-by-4 matrix into a 16-by-1 or 1-by-16 vector and computing the RMS value for the vector.
This object implements the algorithm, inputs, and outputs described on the RMS block reference page. The object properties correspond to the Simulink® block parameters, except:
The Treat sample-based row input as a column block parameter is
not supported by the dsp.RMS
object.
The Reset Port block parameter corresponds to both the ResetCondition
and the ResetInputPort
object properties.