matlab如何实现两个矩阵的去同存异。
1 view (last 30 days)
Show older comments
新锦江娱乐现场经理【微8785092】
on 21 May 2023
Answered: 新锦江娱乐现场客服【微8785092】
on 21 May 2023
M =
0 0
1 1
1 2
1 3
2 1
3 1
3 2
4 1
4 2
T =
0 0
1 1
1 2
2 1
如何将M中和T内容一样的行删掉只保留不同于T的那几行?
0 Comments
Accepted Answer
新锦江娱乐现场客服【微8785092】
on 21 May 2023
仅供参考
M=[0,0;
1,1;
1,2;
1,3;
2,1;
3,1;
3,2;
4,1;
4,2];
T=[0,0;
1,1;
1,2;
2,1];
[r,v]=size(M);
[C,ia,ib] = intersect(M,T,'rows');
C1 = M(setdiff(1:r,ia),:)
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!