How to filter unwanted list from total list

2 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2016-5-21
setdiff(TotalList, UnwantedList)
  3 个评论
Mekala balaji
Mekala balaji 2016-5-21
编辑:Walter Roberson 2016-5-21
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 2016-5-21
mask = any(ismember(TotalList, unwantedList),2);
row_index_to_remove = find(mask);
TotalList(mask,:) = [];

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Acquisition Toolbox Supported Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by