码迷,mamicode.com
首页 > 其他好文 > 详细

matlab中setdiff的用法

时间:2015-01-11 13:34:49      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:matlab   基础学习   

帮助文档内容:

    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中没有的那些行。



matlab中setdiff的用法

标签:matlab   基础学习   

原文地址:http://blog.csdn.net/u013476464/article/details/42610433

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!