How to find unique
2 次查看(过去 30 天)
显示 更早的评论
I have two columns of numbers, X and Y, and i need to find each unique combination of numbers, so far i have this code
s=0
for i=1:n;
if length(unique(x(i)))==x(i);
s=s+length(unique(y(i)));
else if length(unique(y(i)))==y(i);
s=s+length(unique(x(i)));
end
end
end
I'm getting closer to my answer, so hopefully it just needs a few small tweaks, but i can't figure out what?
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!