matlab中any 函数的作用是什么了

如题所述

ANY    True if any element of a vector is a nonzero number or is
    logical 1 (TRUE).  ANY ignores entries that are NaN (Not a Number).

判断向量中是否存在非零元素,若存在返回1,否则返回0(忽略NaN元素)。

any([0 1])   % 为真,存在非零元
any([0 0])   % 为假

温馨提示:答案为网友推荐,仅供参考
相似回答