ICP fit points in data to the points in model. Fit with respect to minimize the sum of square errors with the closest model points and data points.
Ordinary usage:
[R, T] = icp(model,data)
INPUT:
model - matrix with model points,
data - matrix with data points,
OUTPUT:
R - rotation matrix and
T - translation vector accordingly
so
newdata = R*data + T .
newdata are transformed data points to fit model
see help icp for more information
% A 2D homogeneous convection-diffusion case (u=exp(-ex*deta*x-ex*deta*y) with a square with
% all Dirichlet boundary, note that reaction coefficient is not zero
% by indirect BKM
A 2D homogeneous Helmholtz case (u=sin(x)cos(y) with a square) with
% two Dirichlet edges (x=1,y=1) and two Neumann edges (x=0,y=0)
% by indirect symmetric BKM
How the K-mean Cluster work
Step 1. Begin with a decision the value of k = number of clusters
Step 2. Put any initial partition that classifies the data into k clusters. You may assign the training samples randomly, or systematically as the following:
Take the first k training sample as single-element clusters
Assign each of the remaining (N-k) training sample to the cluster with the nearest centroid. After each assignment, recomputed the centroid of the gaining cluster.
Step 3 . Take each sample in sequence and compute its distance from the centroid of each of the clusters. If a sample is not currently in the cluster with the closest centroid, switch this sample to that cluster and update the centroid of the cluster gaining the new sample and the cluster losing the sample.
Step 4 . Repeat step 3 until convergence is achieved, that is until a pass through the training sample causes no new assignments.