www.gusucode.com > signal 案例源码程序 matlab代码 > signal/PeakMagnitudetoRMSRatiosOf2DMatrixExample.m

    %% Peak-Magnitude-to-RMS Ratios 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.

% Copyright 2015 The MathWorks, Inc.


%%
% Compute the peak-magnitude-to-RMS ratios of the columns. 

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

y = peak2rms(x)