且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用Matlab在矩阵中查找唯一的(非重复的)值

更新时间:2023-02-26 15:55:03

这里很短

value = A(sum(bsxfun(@eq, A(:), A(:).'))==1);

它比较矩阵中的所有成对元素,并计算它们相等的次数,并返回仅计数一次的元素.

It compares all pairs of elements in the matrix and counts how many times they are equal and returns the ones that have been counted only once.