MATLAB Application Program Interface | Search  Help Desk |
mxGetScalar | See Also |
Get the real component of an mxArray's
first data element
real*8 function mxGetScalar(pm) integer*4 pmpm
mxArray
.
The value of the first real (nonimaginary) element of the mxArray
. If the mxArray
is larger than 1-by-1, mxGetScalar
returns the value of the (1,1)
element.
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.
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.
mxGetM
, mxGetN