calcCluster
(method of orientation)
sort orientations into clusters
Syntax
[c,center] = calcCluster(ori,'halfwidth',2.5*degree) [c,center] = calcCluster(ori,'numCluster',n,'method','hierarchical') [c,center] = calcCluster(ori,'maxAngle',omega,'method','hierarchical')
Input
ori | |
n |
number of clusters |
omega |
maximum angle |
Output
c |
list of clusters |
center |
center of the clusters |
Example
% generate orientation clustered around 5 centers cs = crystalSymmetry('432'); center = orientation.rand(5,cs); odf = unimodalODF(center,'halfwidth',5*degree) ori = odf.calcOrientations(1500);
odf = ODF crystal symmetry : 432 specimen symmetry: 1 Radially symmetric portion: kernel: de la Vallee Poussin, halfwidth 5° center: Rotations: 5x1 weight: 1
% find the clusters and its centers
[cId,centerRec] = calcCluster(ori);
progress: 100% progress: 100% progress: 100% progress: 100% .......................
% visualize result for i = 1:length(centerRec) plot(ori(cId==i),'axisAngle') hold on plot(centerRec(i),'MarkerFaceColor','k','MarkerSize',15) end hold off

%check the accuracy of the recomputed centers
min(angle_outer(center,centerRec)./degree)
ans = Columns 1 through 7 1.0908 2.5028 1.0905 2.4266 3.1024 16.8809 15.0295 Columns 8 through 9 14.5244 14.8922
MTEX 5.0.3 |