| MATLAB C++ Math Library | Search  Help Desk |
| tobool |
Convert an array to a Boolean value by reducing the rank of the array to a scalar
C++ Prototype
bool tobool(const mwArray &t);
C++ Syntax
#include "matlab.hpp"
if (tobool(A != 0))
{
// test succeeded, do something
}