Kmeans with matrix data
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi everyone I would need to use kmeans for a data matrix 120 * 28 where 120 is the number of elements of which I have the 28 observations in a certain period of time. Can I use kmean? How can I get a chart like this?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/336159/image.png)
Attached are my details.
% k-means model
[idx C] = kmeans(pers_ML_allSim,3);
% k-means con distanza diversa da quella Euclidea
[idx2 C2] = kmeans(pers_ML_allSim,3,"Distance","cityblock","Replicates",5);
댓글 수: 0
답변 (1개)
Rajani Mishra
2020년 7월 28일
The example image mentioned in the question is from this link : https://www.mathworks.com/help/stats/kmeans.html.
For similar results store your data in a matrix and use the same matrix in place of "X" matrix used in the code mentioned in the documentation link.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!