MATLAB: Minimum value of a matrix with the main diagonal elements equals to zero

matrix manipulationminimum

Hello,
I have a 10×10 matrix where the main diagonal is zeros.
How the minimum value of the elements is calculated, excluding the zeros?
Thank you.
Best,
Pavlos

Best Answer

out = min(A(A~=0))