How to find the unique values between two datasets?

Dear all,
I have two datasets. The fisrt one is the ground truth reference, A={(1,2,3),(1,2,4),(1,3,5),(1,2,6)}. The next is the oberserved data, B={(1,2,6),(1,2,4)}
How can I get the result something like C=A-B, C={(1,2,3),(1,3,5)} ? C represents which are not detected by method.
The length of B is not equal to A, and the lines in dataset is not in order.
I do appreciate for all of you!
The right input for Matlab:
A = [1 2 3; 1 2 4; 1 3 5; 1 2 6];
B = [1 2 6; 1 2 4];
thanks to Guillaume

 채택된 답변

Guillaume
Guillaume 2019년 4월 12일
Please use valid matlab syntax for your example so we don't have to wonder what your inputs actually are. A={(1,2,3),(1,2,4),(1,3,5),(1,2,6)} is not valid matlab, so we don't know how your sets are stored.
I'm going to assume that they're stored as rows of a matrix as that's the simplest:
A = [1 2 3; 1 2 4; 1 3 5; 1 2 6];
B = [1 2 6; 1 2 4];
setdiff(A, B, 'rows') %simple!

추가 답변 (1개)

Jr. Jim Lee
Jr. Jim Lee 2019년 4월 12일

0 개 추천

Thanks a lot and I will revised my question.

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2019년 4월 12일

편집:

2019년 4월 12일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by