m8ta
You are not authenticated, login. |
|
{1337} | ||||||||||||||
Useful numbers for estimating molecular mean-free-path in vacuum systems: "
| ||||||||||||||
{224} |
ref: notes-0
tags: k-means clustering neurophysiology sorting
date: 01-03-2012 06:51 gmt
revision:1
[0] [head]
|
|||||||||||||
k-means is easy! % i want to do the k-means alg. v = [x y]; nc = 7; dim = cols(v); n = rows(v); cent = rand(nc,dim); d = zeros(n, nc); for k = (1:500) for s = 1:nc d(:,s) = sqrt(sum((v - rvecrep(cent(s, :), n)).^2,2)); end % select the smallest [nada, g] = min(d'); g = g'; for s = 1:nc if(numel(find(g==s)) > 0) cent(s, :) = mean(v(g==s, :)); end end end real data from clementine: |