8x8 matrix with unique values

 
value = A(sum(bsxfun(@eq, A(:), A(:).'))==1);
 
https://www.mathworks.com/help/matlab/ref/bsxfun.html 


Apply element-wise operation to two arrays with implicit expansion enabled

It compares all pairs of elements in the matrix and counts how many times they are equal and returns the ones that have been counted only once.
Previous Post Next Post