Main Content

mxMakeArrayComplex (Fortran)

Convert real mxArray to complex, preserving real data

Fortran Syntax

#include "fintrf.h"
integer*4 mxMakeArrayComplex(pa)
mwPointer pa


Use mxMakeArrayComplex to convert a real mxArray to a complex mxArray. The real part of the updated array contains the real data from the original array.

If pa is empty, then the function returns a complex empty mxArray.

If pa is complex, then the function does nothing.

Input Arguments

expand all

Pointer to a numeric mxArray array.

Output Arguments

expand all

Function status, returned as integer*4. If successful, then the function returns 1.

Returns 0 if unsuccessful. The function is unsuccessful if pa is NULL, nonnumeric, or read-only.

Introduced in R2018b