Main Content

mxCreateDoubleScalar (Fortran)

Scalar, double-precision array initialized to specified value

Fortran Syntax

#include "fintrf.h"
mwPointer mxCreateDoubleScalar(value)
real*8 value

Description

Call mxCreateDoubleScalar to create a scalar mxArray of type mxDouble.

Description

Call mxCreateDoubleScalar to create a scalar double mxArray.

Call mxDestroyArray when you finish using the mxArray.

You can use mxCreateDoubleScalar instead of mxCreateDoubleMatrix in the following situation.

Replace:With:
pm = mxCreateDoubleMatrix(1, 1, 0)
mxCopyReal8ToPtr(value, mxGetDoubles(pm), 1)
pm = mxCreateDoubleScalar(value)

Input Arguments

expand all

Scalar value, specified as real*8.

Output Arguments

expand all

Pointer to an mxArray, specified as mwPointer, if successful.

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

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

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

Introduced before R2006a