MATLAB® stores complex double-precision data as two vectors of numbers—one vector contains the real data and the other contains the imaginary data. The functions mxCopyPtrToComplex16 and mxCopyComplex16ToPtr copy MATLAB data to a native complex*16 Fortran array.
To build this example, at the command prompt type:
Enter the following at the command prompt:
x = [3 - 1i, 4 + 2i, 7 - 3i]; y = [8 - 6i, 12 + 16i, 40 - 42i];
z = convec(x, y)
z = 1.0e+02 * Columns 1 through 4 0.1800 - 0.2600i 0.9600 + 0.2800i 1.3200 - 1.4400i 3.7600 - 0.1200i Column 5 1.5400 - 4.1400i
which agrees with the results the built-in MATLAB function conv.m produces.