MATLAB: Finding Of Same Values in Matrix

same values

Hi everbody
I have a matrix includes 1724 values, i want to find which elements are same in this matrix (For ex. 25. and 426. values are same etc.)
How can i make this?
Thanks..

Best Answer

What about using unique and a brute force approach:
m = randi(10, 1, 100) % Sample data.
allValues = unique(m); % Find unique numbers.
for k = 1 : length(allValues)
thisValue = allValues(k);
indexes{k} = find(m == thisValue);
fprintf('The number %f is found at indexes : ', thisValue);
fprintf('%d ', indexes{k});
fprintf('\n');
end
% celldisp(indexes)