function [mag,angle,validOut] = Complex2MagAngle(yIn,validIn)
%Complex2MagAngle 
% Converts one sample of complex data to magnitude and angle data.
% yIn is a fixed-point complex number.
% validIn is a logical scalar value.
% You can generate HDL code from this function.

  persistent cma;
  if isempty(cma)
    cma = dsp.HDLComplexToMagnitudeAngle('AngleFormat','Radians');
  end   
  [mag,angle,validOut] = cma(yIn,validIn);
end

