Main Content

mxCreateDoubleScalar (C)

Scalar, double-precision array initialized to specified value

C Syntax

#include "matrix.h" mxArray *mxCreateDoubleScalar(double value);

Description

CallmxCreateDoubleScalarto create a scalarmxArrayof typemxDouble.

You can usemxCreateDoubleScalarinstead ofmxCreateDoubleMatrixin the following situation.

Replace: With:
pa = mxCreateDoubleMatrix(1, 1, mxREAL); *mxGetDoubles(pa) = value;
pa = mxCreateDoubleScalar(value);

CallmxDestroyArraywhen you finish using themxArray.

Input Arguments

expand all

Scalar value, specified asdouble.

Output Arguments

expand all

Pointer to anmxArrayof typemxDouble, specified asmxArray *, if successful.

The function is unsuccessful when there is not enough free heap space to create themxArray.

  • MEX file — Function terminates the MEX file and returns control to the MATLAB®prompt.

  • Standalone (non-MEX file) application — Function returnsNULL.

Version History

Introduced before R2006a