Yes, it run well, and the the code is wery helpfull.
I've found that, the convhull function yield a different result in version 2008a and 2011b. the convhull(x,y) in version 2008a is similar with convhull(x,y,'simplify',true) in version 2011b.
That's why, the 2008 version run faster than 2011a(without parameter simplify).
From the doc (http://www.mathworks.com/help/techdoc/rn/bsk8h3i-1.html#bsljqrp-1)
The simplify option for convhull provides the option of removing vertices that do not contribute to the area or volume of the convex hull.
Thanks again for your answer.
For your information, I've just tried in the different version of matlab (2008a and 2011b). Just wonder that I got the different result with the same code. I don't know why and the 2011b version is slight slower than 2008b.
Thank you for your kind attention.
Thank you so much for your sharing code, it is very impressive.
I've read your paper and I would like to ask about the median MG (step 6). I confuse the use of MG and about calculating the MX in step 5 and step 6, since in your code, you didn't do anything about MG.
Thank you very much for your kind response.