How to detect the repetition of any number in a array?
2 views (last 30 days)
KSSV on 21 Aug 2017
Check unique. If the length of your array and length of unique are not same it has repeated numbers.
a=[4 5 8 9 4] ;
b = unique(a) ;
fprintf('array has repeated numbers\n')
fprintf('array has no repeated numbers\n')