%% Magnitudes of Random Numbers
% Generate a 2-by-4-by-2 array of Gaussian random numbers. Assume the numbers are expressed in decibels and compute the corresponding magnitudes.

r = randn(2,4,2);

mags = db2mag(r)

%
% Use the definition to check the calculation.

chck = 10.^(r/20)

% Copyright 2015 The MathWorks, Inc.