%% Peak-Magnitude-to-RMS Ratios of 2-D Matrix Along Specified Dimension
% Create a matrix in which 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 RMS levels of the rows, specifying the dimension equal to 2 with the dim argument.

t = 0:0.001:1-0.001;
x = (1:4)'*cos(2*pi*100*t);

y = peak2rms(x,2)

% Copyright 2015 The MathWorks, Inc.