How to find unique
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!