How to filter unwanted list from total list

4 Ansichten (letzte 30 Tage)
Mekala balaji
Mekala balaji am 21 Mai 2016
Kommentiert: Walter Roberson am 21 Mai 2016
Hi,
I have two tables 1. Total list, 2. Unwanted list. Now, I want to filter out the unwanted list from total list. The data is cell array.
Kindly some suggest me how to do this. Many thanks in advance.
Total list:
BG08HYK
VF8Y6K
VP0K86KL
VB180KET
VF07K6G
VA00KE
VF8Y6K
VP0K86KL
VB180KET
VF78KE9K
VP0K166KU
VB180KET
VF89K6G
VA00KE9K
Unwanted List:
VF07K6G
VF8Y6K
VF78KE9K
VB180KET

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 21 Mai 2016
setdiff(TotalList, UnwantedList)
  3 Kommentare
Mekala balaji
Mekala balaji am 21 Mai 2016
Bearbeitet: Walter Roberson am 21 Mai 2016
Sir, one more help, I have below total list, if a particular row either column one or column2 belongs to unwanted list, and then remove total row. Sir, ( I also want the row index).
BG08HYK VP0K86KL
VF8Y6K VB180KET
VP0K86K LVF07K6G
VB180KET VA00KE
VF07K6G VF8Y6K
VA00KE VP0K86KL
VF8Y6K VB180KET
VP0K86KL VF78KE9K
VB180KET BG08HYK
VF78KE9K VF8Y6K
VP0K166KU VP0K86KL
VB180KET VB180KET
VF89K6G VF8Y6K
VA00KE9K VP0K86KL
Walter Roberson
Walter Roberson am 21 Mai 2016
mask = any(ismember(TotalList, unwantedList),2);
row_index_to_remove = find(mask);
TotalList(mask,:) = [];

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by