mxSetData (C and Fortran) - Set pointer to data
C Syntax
#include "matrix.h"
void mxSetData(mxArray *pm, void *pr);
Fortran Syntax
mxSetData(pm, pr)
mwPointer pm, pr
Arguments
- pm
Pointer to an mxArray
- pr
Pointer to an array. Each element in the array contains the
real component of a value. The array must be in dynamic memory; call mxCalloc to allocate this memory.
Description
mxSetData is similar to mxSetPr, except that in C, its second argument is a void *. Use this 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 mxGetData before
you call mxSetData.
See Also
mxCalloc, mxFree, mxGetData, mxSetPr
 | mxSetClassName (C) | | mxSetDimensions (C and Fortran) |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit