Rank: 210202 based on 0 downloads (last 30 days) and 0 file submitted
photo

Yung-Yeh

E-mail

Personal Profile:

Professional electrical and computer engineer in signal processing, image processing, pattern recognition, simulation, and modeling.


 

Watch this Author's files

 

Comments and Ratings by Yung-Yeh View all
Updated File Comments Rating
03 May 2014 Find nearest-matching string from a set Computes shortest distance between a key string and a set of strings to find the nearest match. Author: Brandon Kuczenski

Oh...I see

It's actually the Levenshtein distance. The title "nearest-matching string" really confuses me.

03 May 2014 Find nearest-matching string from a set Computes shortest distance between a key string and a set of strings to find the nearest match. Author: Brandon Kuczenski

This is weird, I tried

[x,d] = strnearest('ABC',{'""','"ABC"'})

but it return
x = [1 2]
d = 3

06 Dec 2013 SCATTERCLOUD Scatterplot over a density cloud. Author: Steve Simon

Very nice and decent code for displaying scatterplot in the 2D map with color for empirical distribution. The counting part was efficient only if you have a larger dataset but set a smaller # of bins. If you increase bin to larger than certain value it starts to get slowly even you have smaller dataset. I can't think of anything better but use an alternative approach for the condition with smaller dataset, and switch to the original method if the # of bin is actually smaller.

Following is my approach, similar to BLu's but with better decision switching between two methods. BTW, the centering bug was fixed in this version based on Thomas's post so length(C) == n

% do counts
if numel(x) < n^2
% New method
binIntX = diff(limitX)/(n-1);
binIntY = diff(limitX)/(n-1);
for idx = 1:numel(x)
idxX = min([round(x(idx)/binIntX)+1 numX]);
idxY = min([round(y(idx)/binIntY)+1 numY]);
C(idxY,idxX) = C(idxY,idxX) + 1;
end
else
% Old method
for i = 1:numY-1
for j = 1:numX-1
C(i,j) = length(find(x >= xEdges(j) & x < xEdges(j+1) &...
y >= yEdges(i) & y < yEdges(i+1)));
end
end
end

Contact us