RSS Level of Sinusoid
Compute the RSS level of a 100 Hz sinusoid sampled at 1 kHz.
t = 0:0.001:1-0.001; x = cos(2*pi*100*t); y = rssq(x)
y = 22.3607
RSS Levels of 2-D Matrix
Create a matrix where each column is a 100 Hz sinusoid sampled at 1 kHz with a different amplitude. The amplitude is equal to the column index.
Compute the RSS levels of the columns.
t = 0:0.001:1-0.001; x = cos(2*pi*100*t)'*(1:4); y = rssq(x)
y = 1×4 22.3607 44.7214 67.0820 89.4427
RSS Levels of 2-D Matrix Along Specified Dimension
Create a matrix where each row is a 100 Hz sinusoid sampled at 1 kHz with a different amplitude. The amplitude is equal to the row index.
Compute the RSS levels of the rows by specifying the dimension with the
t = 0:0.001:1-0.001; x = (1:4)'*cos(2*pi*100*t); y = rssq(x,2)
y = 4×1 22.3607 44.7214 67.0820 89.4427
x — Input array
vector | matrix | N-D array
Input array, specified as a vector, matrix, or N-D array.
cos(2*pi*100*(0:0.001:1-0.001)) specifies a sinusoid
sampled at 1 kHz for 1 second.
Complex Number Support: Yes
dim — Dimension to operate along
positive integer scalar
Dimension to operate along, specified as a positive integer scalar.
y — Root-sum-of-squares level
scalar | vector | matrix | N-D array
Root-sum-of-squares level, returned as a scalar, vector, matrix, or N-D array.
The root-sum-of-squares (RSS) level of a vector, x, is
with the summation performed along the specified dimension. The RSS level is also referred to as the 2-norm.
 IEEE® Standard on Transitions, Pulses, and Related Waveforms, IEEE Standard 181, 2003.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
If you supply
dim, then it must be constant.
For limitations related to variable-size inputs, see Variable-Sizing Restrictions for Code Generation of Toolbox Functions (MATLAB Coder).
Code generation does not support sparse matrix inputs for this function.
Run code in the background using MATLAB®
backgroundPool or accelerate code with Parallel Computing Toolbox™
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Version HistoryIntroduced in R2012a
rssq function supports
objects. You must have Parallel Computing Toolbox™ to use this functionality.