| MATLAB Application Program Interface Reference | Help Desk |
mxIsLogical
True ifmxArray is Boolean
#include "matrix.h" bool mxIsLogical(const mxArray *array_ptr);array_ptr
true if the mxArray's logical flag is on; otherwise, returns false. If an mxArray does not hold numerical data (for instance, if array_ptr points to a structure mxArray or a cell mxArray), then mxIsLogical automatically returns False.
Use mxIsLogical to determine whether MATLAB treats the data in the mxArray as Boolean (logical) or numerical (not logical).
If an mxArray is logical, then MATLAB treats all zeros as meaning false and all nonzero values as meaning true.
mxIsClass, mxSetLogical