Thus far, I have find(diff(A)==0), however this only proves useful if the elements are adjacent. I am wondering how identify whether or not a number occurs more than once within an array, regardless of position.
Thanks in advance for your time and help. 🙂
Try this. If
Ais your matrixCwill contain the unique elements ofAso if the length is the same you have all unique elements. If you want to test a specific value tryawhich will return the number of elements in
Aequal tovalue