External Interfaces/API Reference    
mxSetImagData

Set imaginary data pointer for an mxArray

Fortran Syntax

Arguments

pm
   Pointer to an mxArray.

pi
   Pointer to the first element of an array. Each element in the array contains the imaginary component of a value. The array must be in dynamic memory; call mxCalloc to allocate this dynamic memory. If pi points to static memory, memory errors will result when the array is destroyed.

Description

Use mxSetImagData to set the imaginary data of the specified mxArray.

Most mxCreate* functions optionally allocate heap space to hold imaginary data. If you tell an mxCreate* function to allocate heap space (for example, by setting the ComplexFlag to COMPLEX = 1 or by setting pi to a nonzero value), then you do not ordinarily use mxSetImagData to initialize the created mxArray's imaginary elements. Rather, you call mxSetImagData to replace the initial imaginary values with new ones.

Free the memory used by pi by calling mxDestroyArray to destroy the entire mxArray.

mxSetImagData is equivalent to using mxSetPi.

See Also

mxSetData, mxGetImagData, mxGetData, mxSetPi


  mxSetFieldByNumber mxSetIr