Compare to rows and delete matching rows
显示 更早的评论
Update: I have attached to mat files. I want to compare the rows in file A to that of file B. If a number in the first column of B matches with that of a number in the first column of A, then the entire row in A in which the number matches with that in B should be deleted. So example if you look at file B, the number 12 is in column 1, row 2 and it matches with column 1, row 4 in A. In this case I want a code that will delete the entire row 4 in A. I will now be left with 6by4 matrix. I am trying to compare the headers and use it as a quide to remove rows in A that I dont want. I have a very large data set and having a code that can do this will be very helpful.
Thanks!
4 个评论
Rik
2019-3-10
Your screenshots look like your data is still in Excel and not yet in Matlab arrays. Once they are in Matlab you should be able to use ismember. What have you tried so far?
Curious Mind
2019-3-10
Image Analyst
2019-3-11
Make it easy for people to help you by attaching your Excel workbook.
Curious Mind
2019-3-11
采纳的回答
更多回答(1 个)
Image Analyst
2019-3-10
0 个投票
Try ismember() or ismembertol().
类别
在 帮助中心 和 File Exchange 中查找有关 Large Files and Big Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!