MATLAB: How to get the mode of a 3d-array

3d arraymodemost frequent valuesmrivolumetric image

Dear experts,
how do I get the mode of a 3D array with dim [51 75 55]. It can only contain numbers from 0:12 and I'm not interested in the zeros.

Best Answer

mode(nonzeros(yourArray)),
Related Question