| MATLAB Application Program Interface | Search  Help Desk |
| mxSetPr | Examples See Also |
Set new real data for an mxArray
C Syntax
#include "matrix.h" void mxSetPr(mxArray *array_ptr, double *pr);
Arguments
array_ptrmxArray.
pr
mxCalloc to allocate this dynamic memory. If pr points to static memory, then memory leaks and other memory errors may result.
Description
UsemxSetPr to set the real data of the specified mxArray.
All mxCreate calls allocate heap space to hold real data. Therefore, you do not ordinarily use mxSetPr to initialize the real elements of a freshly-created mxArray. Rather, you call mxSetPr to replace the initial real values with new ones.
Example
Seemxsetnzmax.c in the mx subdirectory of the examples directory.
See Also
mxGetPr, mxGetPi, mxSetPi