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 0.4280 0.5438 0.9432 1.0109 1.5244 16.0829 15.2245 Columns 8 through 11 14.2591 15.3038 18.2253 14.4350
MTEX 5.0.0 |