how can we compare two columns for a particular value of another column?
3 次查看(过去 30 天)
显示 更早的评论
i have n by 7 columns of data,
for a particular value in a column 1(ranges from 1 to 60),i want to check if the values in column 4 and 5 are repeating or not,also i want to check if same set of values interchanged and delete such repeated values.
could anyone please help me in getting this done.
thanks in advance.
0 个评论
采纳的回答
Matt J
2021-6-10
编辑:Matt J
2021-6-10
Say A is the matrix of values.
[~,uniqueRows]=unique(A(:,[1,4,5]),'rows')
This will tell you which rows can be kept so as to obtain unique combinations of values in columns 1,4, and 5. The other rows can be discarded. Is that not what you want?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!