How to do it?

조회 수: 1 (최근 30일)
Negar
Negar 2014년 11월 30일
댓글: Image Analyst 2014년 11월 30일
Hello all,
Is there any tutorial to learn implementing a flow chart in MATLAB? By flow chart, I mean something like this:
Let´s assume I have a data set, say 24 data points , each of which 2 dimensions. Id like to cluster them in an un pre-defined number of classes. Here is the instruction:
1.FIRST: Find the center(mean) point of the whole dataset. Split this point into 2 center points. Assign each datapoint to the nearest center. 2.NOW: for each center point, repeat point 1 until none of the data points changes its membership. I think it is working in a way similar to kmeans algorithm, but the number of the classes is not defined in advance.
thank you!
  댓글 수: 1
Negar
Negar 2014년 11월 30일
Actually, Im stuck in the very basic part of the algorithm, I don't know how to relate each step to its previous. I have made a try, but it seems my code is not splitting the center point, it just changes its position. Here is my code:
c = [3;2.25]; % the center point of the whole dataset
k = 1 ;
eps = 1e-3;
while k<3
%split the centroid in 2
c(:,k+1) = c(:,k) + eps; % the first one
d(:,k+1) = c(:,k) - eps; % this is not working as expected!! So how to fix it?
k = k+1;
end

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

답변 (1개)

Image Analyst
Image Analyst 2014년 11월 30일
Try these links on machine learning:
Look at the Statistics and Machine Learning section here:
especially the section on unsupervised learning.
  댓글 수: 2
Negar
Negar 2014년 11월 30일
Thank you for responding, could you please have a look at my code? I can't manage how to store the center points.
Image Analyst
Image Analyst 2014년 11월 30일
I don't know what the code does exactly but it runs without any errors at all:
c = [3;2.25]; % the center point of the whole dataset
k = 1 ;
eps = 1e-3;
while k<3
%split the centroid in 2
c(:,k+1) = c(:,k) + eps; % the first one
d(:,k+1) = c(:,k) - eps; % this works - nothing to fix.
k = k+1;
end
c
d
But you should not use eps as the name of a variable since it's the name of a built in function.

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

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by