MATLAB Application Program Interface Reference | Help Desk |
mxIsNumeric
True ifmxArray
is numeric or a string
#include "matrix.h" bool mxIsNumeric(const mxArray *array_ptr);array_ptr
True
if the array's storage type is
mxDOUBLE_ARRAY
mxSPARSE_ARRAY
mxFLOAT_ARRAY
mxINT8_ARRAY
mxUINT8_ARRAY
mxINT16_ARRAY
mxUINT16_ARRAY
mxINT32_ARRAY
mxUINT32_ARRAY
False
if the array's storage type is
mxCELL_ARRAY
mxCHARACTER_ARRAY
mxSTRUCTURE_ARRAY
mxIsNumeric
to determine if the specified array contains numeric data. If the specified array is a cell or a structure, then mxIsNumeric
returns False
. Otherwise, mxIsNumeric
returns True
.
Call mxGetClassID
to determine the exact storage type.
Note that mxIsNumeric
behaves somewhat differently in MATLAB 5 than in MATLAB 4. MATLAB 4 distinguished between string data and numeric data; therefore, the MATLAB 4 mxIsNumeric
returned false
if the specified array held string data. By contrast, the MATLAB 5 mxIsNumeric
does not distinguish between string data and numeric data; MATLAB 5 typically stores strings inside an array having one of the integer types. Therefore, the MATLAB 5 mxIsNumeric
returns True
if the specified array contains a string.
mxGetClassID