Thanks for the code. I have problems trying to run it under Win7 64 bits with a 64bits Matlab version also. It says "Microsoft Visual C++ 2005 or 2008 is required to use this feature." While loading a library. I've installed the runtime libraries from visual studio but it didn't work. Any idea?