External Interfaces/API Reference    
mxGetScalar

Get the real component of an mxArray's first data element

Fortran Syntax

Arguments

pm
   Pointer to an mxArray.

Returns

The value of the first real (nonimaginary) element of the mxArray. If pm points to a sparse mxArray, mxGetScalar returns the value of the first nonzero real element in the mxArray.

If pm points to an empty mxArray, mxGetScalar returns an indeterminate value.

Description

Call mxGetScalar to get the value of the first real (nonimaginary) element of the mxArray.

In most cases, you call mxGetScalar when pm points to an mxArray containing only one element (a scalar). However, pm can point to an mxArray containing many elements. If pm points to an mxArray containing multiple elements, mxGetScalar returns the value of the first real element. If pm points to a two-dimensional mxArray, mxGetScalar returns the value of the (1,1) element.

See Also

mxGetM, mxGetN


  mxGetPr mxGetString