-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be7f6cb
commit 48dbbe4
Showing
117 changed files
with
1,067 additions
and
258 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
--- | ||
title: Cluster demo | ||
last_updated: 11-Dec-2020 | ||
sidebar: documentation_sidebar | ||
permalink: ClusterDemo.html | ||
folder: documentation | ||
toc: false | ||
--- | ||
<html><head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<!-- | ||
This HTML was auto-generated from MATLAB code. | ||
To make changes, update the MATLAB code and republish this document. | ||
--><title>Cluster demo</title><meta name="generator" content="MATLAB 9.10"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2020-12-11"><meta name="DC.source" content="script_ClusterDemo.m"></head><body><font size="2"><a href="https://github.com/mtex-toolbox/mtex/blob/develop/doc/GeneralConcepts/ClusterDemo.m"> | ||
edit page</a></font><div><!--introduction--><!--/introduction--> | ||
{% highlight matlab %} | ||
cs = crystalSymmetry('432'); | ||
odf = unimodalODF(orientation.rand(2,cs),'halfwidth',5*degree) | ||
|
||
|
||
ori = odf.discreteSample(10000) | ||
|
||
r = ori * Miller(1,0,0,odf.CS) | ||
|
||
%scatter(r) | ||
{% endhighlight %} | ||
|
||
{% highlight plaintext %} | ||
odf = ODF | ||
crystal symmetry : 432 | ||
|
||
Radially symmetric portion: | ||
kernel: de la Vallee Poussin, halfwidth 5° | ||
center: Rotations: 2 x 1 | ||
weight: 1 | ||
|
||
|
||
ori = orientation | ||
size: 10000 x 1 | ||
crystal symmetry : 432 | ||
|
||
r = vector3d | ||
size: 10000 x 1 | ||
{% endhighlight %} | ||
|
||
{% highlight matlab %} | ||
[cId,center] = calcCluster(r,'numCluster',12); | ||
|
||
plotCluster(r,cId) | ||
|
||
annotate(center,'add2all') | ||
{% endhighlight %} | ||
<center> | ||
{% include inline_image.html file="ClusterDemo_01.png" %} | ||
</center> | ||
{% highlight matlab %} | ||
r.antipodal = true | ||
|
||
[cId,center] = calcCluster(r,'numCluster',6); | ||
|
||
plotCluster(r,cId) | ||
|
||
annotate(center,'add2all') | ||
{% endhighlight %} | ||
|
||
{% highlight plaintext %} | ||
r = vector3d | ||
size: 10000 x 1 | ||
antipodal: true | ||
{% endhighlight %} | ||
<center> | ||
{% include inline_image.html file="ClusterDemo_02.png" %} | ||
</center> | ||
{% highlight matlab %} | ||
h = ori \ vector3d(1,2,0); | ||
|
||
[cId,center] = calcCluster(h,'numCluster',2); | ||
|
||
plotCluster(h.project2FundamentalRegion,cId,'fundamentalSector') | ||
|
||
annotate(center,'add2all') | ||
{% endhighlight %} | ||
<center> | ||
{% include inline_image.html file="ClusterDemo_03.png" %} | ||
</center> | ||
{% highlight matlab %} | ||
[cId,center] = calcCluster(ori,'numCluster',2,'method','hierarchical'); | ||
|
||
plotCluster(r,cId) | ||
|
||
annotate(center * Miller(1,0,0,ori.CS),'add2all') | ||
{% endhighlight %} | ||
<center> | ||
{% include inline_image.html file="ClusterDemo_04.png" %} | ||
</center> | ||
{% highlight matlab %} | ||
[cId,center] = calcCluster(ori,'numCluster',2,'method','odf'); | ||
|
||
plotCluster(r,cId) | ||
|
||
annotate(center * Miller(1,0,0,ori.CS),'add2all') | ||
{% endhighlight %} | ||
|
||
{% highlight plaintext %} | ||
... | ||
{% endhighlight %} | ||
<center> | ||
{% include inline_image.html file="ClusterDemo_05.png" %} | ||
</center> | ||
{% highlight matlab %} | ||
% compute the full distance matrix | ||
d = angle_outer(r,r); | ||
d(d<0.01) = 0; | ||
%d = d(triu(true(size(d)),1)); | ||
d = squareform(d); | ||
|
||
|
||
% use the statistic toolbox | ||
z = linkage(d,'single'); | ||
|
||
%cId = cluster(z,'cutoff',30*degree); | ||
cId = cluster(z,'maxclust',12); | ||
|
||
plotCluster(r,cId) | ||
{% endhighlight %} | ||
|
||
{% highlight matlab %} | ||
function plotCluster(r,cId,varargin) | ||
|
||
scatter(r(cId==1),'MarkerFaceColor',ind2color(1),varargin{:}) | ||
hold on | ||
for i = 2:max(cId) | ||
scatter(r(cId==i),'add2all','MarkerFaceColor',ind2color(i),varargin{:}) | ||
end | ||
hold off | ||
end | ||
{% endhighlight %} | ||
</div></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.