| External Interfaces/API Reference | ![]() |
Create a scalar, double-precision array initialized to the specified value
C Syntax
#include "matrix.h" mxArray *mxCreateScalarDouble(double value);
Arguments
value
The desired value to which you want to initialize the array.
Returns
A pointer to the created mxArray, if successful. mxCreateScalarDouble is unsuccessful if there is not enough free heap space to create the mxArray. If mxCreateScalarDouble is unsuccessful in a MEX-file, the MEX-file prints an Out of Memory message, terminates, and control returns to the MATLAB prompt. If mxCreateScalarDouble is unsuccessful in a stand-alone (nonMEX-file) application, mxCreateScalarDouble returns NULL.
Description
Call mxCreateScalarDouble to create a scalar double mxArray. mxCreateScalarDouble is a convenience function that can be used in place of the following code:
pa = mxCreateDoubleMatrix(1, 1, mxREAL); *mxGetPr(pa) = value;
When you finish using the mxArray, call mxDestroyArray to destroy it.
See Also
| mxCreateNumericMatrix | mxCreateSparse | ![]() |