标签: matlab find return-value
如果Matlab中的find()函数无法找到给定条件的任何内容,则会返回并清空1x0矩阵。如何检查是否确实如此 - 提供的矩阵中给定的标准是否满足?
find()
答案 0 :(得分:3)
查看isempty
isempty
b = [ 1 2 3 5 ]; a = find( b == 4 ); if isempty( a ) fprintf(1,'not found\n'); end