<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hello,</div>
<div> </div>
<div>I want to get the duplicates of a vector. Lets say I have a vector as follows:</div>
<div> </div>
<div>A = [ 1 5 3 2 3 1 ];</div>
<div> </div>
<div>I want to get a vector which contains the duplicates [1 3].</div>
<div> </div>
<div>I found intersect, union and unique but they give me just the vector w/o the duplicates. In this example unique(A)=>[1 2 3 5]. So I just need a function to compare the original vector A with the results of lets say unique(A) and return the remaining members. Can this be done vectorized w/o nested for-loops? Or is there a more elegant approach available?</div>
<div> </div>
<div>Thx, Hani</div></div></body></html>