Kmeans does not accept complex numbers

3 vues (au cours des 30 derniers jours)
Ahmad Kamal Bin Mohd Nor
Ahmad Kamal Bin Mohd Nor le 20 Juin 2019
Commenté : Walter Roberson le 20 Juin 2019
Why do Matlab says that kmeans does not accept complex data when my data are not complex numbers?
  2 commentaires
KSSV
KSSV le 20 Juin 2019
May be your data has a complex number.
Check:
nnz(~isreal(data))
If the above gives some number, it means your data has complex numbers.
Walter Roberson
Walter Roberson le 20 Juin 2019
Put a condition breakpoint on the line that calls kmeans, testing your data. Suppose that your data to be clustered is named Data, then the breakpoint condition could be
any(imag(Data(:)))
and run your code. The problem does not necessarily happen immediately.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by