MATLAB: Matrix 9×9 with duplicate values

matrix problem

i have matrix C9x9 with duplicates. i must find duplicate above main diagonale. when i find first duplicate the searching stop and print this duplicate? thanks

Best Answer

i changed matrix to 4x4 and i sould received like solution duplicate above main diagonal nuber 4, i receive solution 3. why?