Skip to Main Content Skip to Search
Product Documentation

mxSetImagData (C and Fortran) - Imaginary data pointer for array

C Syntax

#include "matrix.h"
void mxSetImagData(mxArray *pm, void *pi);

Fortran Syntax

subroutine mxSetImagData(pm, pi)
mwPointer pm, pi

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

mxSetImagData is like mxSetPi, except that in C, its pi argument is a void *. Use this function on numeric arrays with contents other than double.

This function does not free any memory allocated for existing data that it displaces. To free existing memory, call mxFree on the pointer returned by mxGetImagData before you call mxSetImagData.

Examples

See the following examples in matlabroot/extern/examples/mx.

See Also

mxCalloc, mxFree, mxGetImagData, mxSetPi

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS