Sort the clustering matrix

sort_Z(Z)

Arguments

Z

a matrix N x K, with probabilities to belong of a cluster in rows for each observation.

Value

a sorted matrix