function y = wgn(varargin)%WGN Generate white Gaussian noise.% Y = WGN(M,N,P) generates an M-by-N matrix of white Gaussian noise.% P specifies the power of the output noise in dBW.% Y = WGN(M,N,P,IMP) specifies the load impedance in Ohms.% Y = WGN(M,N,P,IMP,STATE) resets the state of RANDN to STATE.% Additional flags that can follow the numeric arguments are:% Y = WGN(., POWERTYPE) specifies the units of P. POWERTYPE can% be dBW, dBm or linear.