I have a small Question,
suppose i have modeled a data.
it has 100 vectors each having 36 features.
so my input is 36 x 100
now i have given 5 clusters,model is trained now.
now i have set of 5 mu(36 x 1) and 5 sigma(36 x 36 x 5).
lets us say i have a unknown vector x of size(36 x 1)
now how to find out,in which cluster this particular vector fits..?
for each cluster we have only mu,and sigma,and for a single vector matlab gives sigle value of mean,and cov()
can you help me in this..?
if it would have been k-means,its easy to calculate euclidean distance with cluster centroid,which ever is minimum,that is answer..

Can You please tell me..about initialization which you have made.
generating random values is fine..
but i havent understood

use of maxVal=bsxfun(@minus,m'*X, sum(m.^2,1)'/2 )
[dum,label] = max(bsxfun(@minus,m'*X,sum(m.^2,1)'/2));
can you please tell me that...?
code is really wonderful,
but if i could get any theory material regarding functions you have written,especially for expectation,maximization,and log gaussian pdf..
please mail me on d.dattatray@gmail.com
thank you in advance...

Add the following at the bottom of the MidPoint Circle function to created filled circles
for ii = xc-int16(radius):xc+(int16(radius))
for jj = yc-int16(radius):yc+(int16(radius))
tempR = sqrt((double(ii) - double(xc)).^2 + (double(jj) - double(yc)).^2);
if(tempR <= double(int16(radius)))
i(ii,jj)=value;
end
end
end

Comment only

19 Feb 2014

distance.m
A fully vectorized function that computes the Euclidean distance matrix between two sets of vectors.

Following the analysis of Stuart Layton, I've found a merely faster way to perform the same computation:
d = sqrt(bsxfun(@minus,bsxfun(@plus,sum(a.^2,1),sum(b.^2,1)'),2*(a'*b).'));
Using the same tool as Stuart Layton (modified to have the tic/toc outside the loop), I measure 4.3607ms for distance.m and 4.1252ms for mine. Does not change dramatically, ok.

4

11 Nov 2013

distance.m
A fully vectorized function that computes the Euclidean distance matrix between two sets of vectors.

This code is extremely useful.
I'm not particularly good in using matlab but i had no trouble understanding how to use it (although it took me a good FIVE minutes).
So Five stars for sure for doing EXACTLY what it says on the box, nothing more and nothing less. You guys should be ashamed for rating less then 5 stars.
For others, to get rid of the gaps I used
FilteredResult=medfilt2(Result, [3 3])
This is how I used this code
(you will now notice i'm no good at matlab)
GGG(1:355,1:355)=0;
xxx(1:355,1:355)=0;
y=rand(1,150);
y=y*50
jj=1;
for j=1:150;
AAA=MidpointCircle(xxx,j,177,177,y(1,jj));
GGG=AAA+GGG;
jj=jj+1;
end;
GGG=medfilt2(GGG, [3 3])
image (GGG)

5

19 Apr 2012

distance.m
A fully vectorized function that computes the Euclidean distance matrix between two sets of vectors.

Comment only