Convert magnitude and/or a phase angle signal to complex signal
Simulink / Math Operations
HDL Coder / HDL Floating Point Operations
The MagnitudeAngle to Complex block converts magnitude and phase angle inputs to a complex output. The angle input must be in rad.
The block supports the following combinations of input dimensions when there are two block inputs:
Two inputs of equal dimensions
One scalar input and the other an ndimensional array
If the block input is an array, the output is an array of complex signals. The elements of a magnitude input vector map to the magnitudes of the corresponding complex output elements. Similarly, the elements of an angle input vector map to the angles of the corresponding complex output elements. If one input is a scalar, it maps to the corresponding component (magnitude or angle) of all the complex output signals.
If you use the CORDIC approximation method [1], the block input for phase angle has the following restrictions:
For signed fixedpoint types, the input angle must fall within the range [–2π, 2π) rad.
For unsigned fixedpoint types, the input angle must fall within the range [0, 2π) rad.
The following table summarizes what happens for an outofrange input:
Block Usage  Effect of OutofRange Input 

Simulation modes  An error appears. 
Generated code  Undefined behavior occurs. 
Ensure that you use an inrange input for the MagnitudeAngle to Complex block when you use the CORDIC approximation. Avoid relying on undefined behavior for generated code or accelerator modes.
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

[1] Volder, Jack E., “The CORDIC Trigonometric Computing Technique.” IRE Transactions on Electronic Computers EC8 (1959); 330–334.
[2] Andraka, Ray “A Survey of CORDIC Algorithm for FPGA Based Computers.” Proceedings of the 1998 ACM/SIGDA Sixth International Symposium on Field Programmable Gate Arrays. Feb. 22–24 (1998): 191–200.
[3] Walther, J.S., “A Unified Algorithm for Elementary Functions,” Proceedings of the Spring Joint Computer Conference, May 1820, 1971: 379–386.
[4] Schelin, Charles W., “Calculator Function Approximation,” The American Mathematical Monthly 90, no. 5 (1983): 317–325.