This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mxSetImagData (Fortran)

Set imaginary data elements in numeric mxArray

mxSetImagData is not available in the interleaved complex API. Use typed, data-access functions instead. For more information, see Compatibility Considerations.

Fortran Syntax

#include "fintrf.h"
subroutine mxSetImagData(pm, pi)
mwPointer pm, pi


The mxSetImagData function is similar to mxSetPi. Use this function on numeric arrays with contents other than double.

The mxSetImagData function does not free memory allocated for existing data. To free existing memory, call mxFree on the pointer returned by mxGetImagData.

Input Arguments

expand all

Pointer to a MATLAB array, specified as mwPointer.

Pointer to the complex data array within an mxArray, specified as mwPointer. Each element in the array contains the imaginary component of a value.

The array must be in dynamic memory; call mxCalloc to allocate this memory. If pi points to static memory, then memory errors result when the array is destroyed.

Compatibility Considerations

expand all

Not recommended starting in R2018b

Errors starting in R2018b

Introduced before R2006a