I want to cluster the data in the attached file to find at which location certain time (period) di dominant. Thus, I want to plot the border of clusterring data in my contour plot.
I find the interesting example in this mathworks example:
% border clustering
xy1 = [randn(50,1) randn(50,1)];
xy2 = [randn(50,1)+5 randn(50,1)];
xy3 = [randn(50,1) randn(50,1)+5];
[idx,c] = kmeans([xy1; xy2; xy3],3)
figure
hold on
plot(xy1(:,1),xy1(:,2),'ro')
plot(xy2(:,1),xy2(:,2),'go')
plot(xy3(:,1),xy3(:,2),'bo')
voronoi(c(:,1),c(:,2))
However, I don't know how to implement such code to my data. Some help is really appreciated.
EK

댓글 수: 6

darova
darova 2019년 11월 18일
try clusterdata
Image Analyst
Image Analyst 2019년 11월 18일
편집: Image Analyst 2019년 11월 18일
  1. What do each of the 3 columns represent?
  2. How many clusters do you think there are? (What is k?)
  3. Why do you think there are clusters in the first place?
  4. Do you want clusters in 3-D or in 2-D (over just two of the columns, if so which ones?)
  5. Exactly what does "certain time (period) di dominant" mean?
data = xlsread('data_test.xls');
plot3(data(:, 1), data(:, 2), data(:, 3), '.', 'MarkerSize', 50);
grid on;
edward kabanyas
edward kabanyas 2019년 11월 18일
Thank you Image analysist. The first column is latitude, second is longitude, third is time/period (period). I want to cluster period into 4 cluster i.e 0-5, 6-11, 12-17, 18-23. I want know at which location/area certain time (period) di dominant by plotting the border of area of each cluster of time.
EK
edward kabanyas
edward kabanyas 2019년 11월 20일
My array is 2 dimensional data (x,y, z) where data(i,j) gives the z coordinate for indices i, j ? I want to form a cluster using Z to see which cluster is located where on spatial map.
Image Analyst
Image Analyst 2019년 11월 21일
Why not use scatter3() where each z value range is given a different color?
And again, I don't know what "di dominant" means? I've never even heard of the adjective "di".
edward kabanyas
edward kabanyas 2019년 11월 21일
>And again, I don't know what "di dominant" means?
Sorry, this is typo, I mean "is dominant"...if we use scatter3(), can we plot the border of the area coverred by z value range on spatial map?

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Scatter Plots에 대해 자세히 알아보기

질문:

2019년 11월 18일

댓글:

2019년 11월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by