MATLAB: I want to find about indexes that are chosen five from biggest number in 2-d matrix.

indexmatrix

i want to find about indexes that are chosen five from biggest number in 2-d matrix.

Best Answer

Edit
A=randi(100,4,4)
[val,id]=sort(A(:),'descend')
max_val=val(1:5)
id=id(1:5)
[ii,jj]=ind2sub(size(A),id)