| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
#include "matrix.h" bool mxIsClass(const mxArray *pm, const char *classname);
integer*4 mxIsClass(pm, classname) mwPointer pm character*(*) classname
Pointer to an mxArray
Array category you are testing. Specify classname as a string (not as an integer identifier). You can specify any one of the following predefined constants:
Value of classname | Corresponding Class |
|---|---|
cell | mxCELL_CLASS |
char | mxCHAR_CLASS |
double | mxDOUBLE_CLASS |
function_handle | mxFUNCTION_CLASS |
int8 | mxINT8_CLASS |
int16 | mxINT16_CLASS |
int32 | mxINT32_CLASS |
int64 | mxINT64_CLASS |
logical | mxLOGICAL_CLASS |
single | mxSINGLE_CLASS |
struct | mxSTRUCT_CLASS |
uint8 | mxUINT8_CLASS |
uint16 | mxUINT16_CLASS |
uint32 | mxUINT32_CLASS |
uint64 | mxUINT64_CLASS |
<class_name> | <class_id> |
unknown | mxUNKNOWN_CLASS |
In the table, <class_name> represents the name of a specific MATLAB custom object. You can also specify one of your own class names.
Logical 1 (true) if pm points to an array having category classname, and logical 0 (false) otherwise.
Each mxArray is tagged as being a certain type. Call mxIsClass to determine whether the specified mxArray has this type.
In C:
mxIsClass(pm, "double");
is equivalent to calling either of these forms:
mxIsDouble(pm); strcmp(mxGetClassName(pm), "double");
In Fortran:
mxIsClass(pm, 'double')
is equivalent to calling either one of the following:
mxIsDouble(pm) mxGetClassName(pm) .eq. 'double'
It is most efficient to use the mxIsDouble form.
See mxisclass.c in the matlabroot/extern/examples/mx folder .
mxClassID, mxGetClassID, mxIsEmpty, mxGetClassName
![]() | mxIsChar (C and Fortran) | mxIsComplex (C and Fortran) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |