필터 지우기
필터 지우기

introduction with k-means in matlab

조회 수: 2 (최근 30일)
tusu
tusu 2014년 8월 29일
편집: the cyclist 2014년 8월 29일
Hi,
I just theoretically read k-means and did an example..
I had 4, 2d items with their coordinates value, and initially k=2
like
  • item variables
  • A (5,3)
  • B (-1,1)
  • C (1,-2)
  • D (-3,-2)
I calculated their centroids and then by measuring euclidean dist among arbitrary cluster and centroids, after calculation I got two cluster (A) and (B,C,D)
I am looking at matlab and found kmeans function but how I could implement the following example in matlab, I got messed up..
any hints for first time concept to implement kmeans using matlab using the following example.
  댓글 수: 1
the cyclist
the cyclist 2014년 8월 29일
Do you mean that you have done it by hand, and you are not sure how to do the same thing with MATLAB?

댓글을 달려면 로그인하십시오.

채택된 답변

the cyclist
the cyclist 2014년 8월 29일
편집: the cyclist 2014년 8월 29일
Is this what you want?
The output does show the two clusters you mention.
X = [ 5 3;
-1 1;
1 -2;
-3 -2];
clusterNumber = kmeans(X,2)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cluster Analysis and Anomaly Detection에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by