This function allows a complex number to be assembled from two numeric expressions. The first expression specifies the real part and the second specifies the imaginary part. This function also allows complex constants, such as CMPLX(PI,6.7), to be expressed in a program.
To assemble a complex number from magnitude and angle rather than real and imaginary parts, use this method:
Z = CMPLX( Magnitude*COS(Angle), Magnitude*SIN(Angle))
If a complex number is used as an argument to CMPLX, then only the real part of the argument is used. For example, CMPLX( CMPLX(1,2), CMPLX(3,4) ) is equal to CMPLX(1,3).