帮助文档内容:
SETDIFF(A,B) when A and B are vectors returns the values
in A that are not in B. The result will be sorted. A and B
can be cell arrays of strings.
SETDIFF(A,B,‘rows‘) when A are B are matrices with the same
number of columns returns the rows from A that are not in B.
理解:
matlab中setdiff()函数作用:判断2个数组中不同元素
c = setdiff(A, B)
返回在A中有,而B中没有的值,结果向量将以升序排序返回。在集合论中,c = A - B。A和B也可以是字符串细胞数组。
c = setdiff(A, B, ‘rows‘)
当A和B是具有相同列数的矩阵时,返回A中有而B中没有的那些行。
时间: 2024-10-25 08:50:48