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

Amir

E-mail

Personal Profile:
Professional Interests:
Subsurface Hydrology

 

Watch this Author's files

 

Comments and Ratings by Amir View all
Updated File Comments Rating
11 Jul 2012 KD Tree Nearest Neighbor and Range Search KD Tree range and nearest neighbor search. Author: Steven Michael

For one dimensional data I am searching, the range search gives some results which are outside the specified range by a tiny bit. e.g. 4-5 orders of magnitude relative to the search window size.

example for reproducing this : (takes a few minutes to complete run)

rng('default')
for i=1:1000
x=rand(100000,1);
tree=kdtree(x);
r=[0.3331 1/3];
idx=kdtree_range(tree,r);
found=x(idx);
if any(found<r(1))
disp(i)
disp(found(found<r(1))-r(1))
end
if any(found>r(2))
disp(i)
disp(found(found>r(2))-r(2))
end
end

23 Feb 2012 KD Tree Nearest Neighbor and Range Search KD Tree range and nearest neighbor search. Author: Steven Michael

I just managed to compile mex files for this submission on windows 64.
It wasn't that easy, and I wasted a few good hours on that, but it works now.
I also admit I know almost nothing about compiling and so forth so there might be better ways to do it, but anyway these were my steps:

1. Installed MS Visual Studio 2010 (warning: it's not free, but luckily my helpdesk had a licensed copy)

2. Opened Matlab, typed
>> mex -setup
and went through the setup process.

3. opened the options file:
C:\Users\apaster\AppData\Roaming\MathWorks\MATLAB\R2011b\mexopts.bat
(find the right location by typing

and added the folder P:\Documents\MATLAB\kdtree\src that contained the source files of kdtree to the options file (lines 25-26):

set PATH=P:\Documents\MATLAB\kdtree\src;%VCINSTALLDIR%\bin\amd64;%VCINSTALLDIR%\bin;%VCINSTALLDIR%\VCPackages;%VSINSTALLDIR%\Common7\IDE;%VSINSTALLDIR%\Common7\Tools;%LINKERDIR%\bin\x64;%LINKERDIR%\bin;%MATLAB_BIN%;%PATH%

set INCLUDE=P:\Documents\MATLAB\kdtree\src;%VCINSTALLDIR%\INCLUDE;%VCINSTALLDIR%\ATLMFC\INCLUDE;%LINKERDIR%\include;%INCLUDE%

seems like if we don't do that, the compiler won't be able to find the kdtree.h file

4. from Matlab, typed:
>> cd 'P:\Documents\MATLAB\kdtree\src'
>> mex kdtree.cpp kdtree_create.cpp
>> mex kdtree_range.cpp kdtree.cpp
>> mex kdtree_closestpoint.cpp kdtree.cpp

5. That's it ! Now just copied the .mexw64 files to \kdtree\@kdtree folder.

Hope this works for you...

27 Jan 2012 Kernel Density Estimator Reliable and extremely fast kernel density estimator for one-dimensional data Author: Zdravko Botev

05 Jan 2012 mpgwrite The MPEG converter takes a MATLAB movie matrix and writes the movie to disk as an MPEG file. Author: David Foti

To Dan Massie (03 Nov 2011) : the problem you noticed is due to the limitations of getframe command ( see http://www.mathworks.com/help/techdoc/ref/getframe.html ), and has nothing to do with mpgwrite.

Contact us