first of all, it's amazing code, thanks a lot for offering such help.
I would appreciate your help telling me how can i use it on a segmented image instead of using "roipoly" function but it dosen't work at all...
really i am in need for like such program to identify colors present in the region of interest that i had already detected using segmentation program...
If you compute ||a-b||, you will have to use loops. MATLAB loops are slow, and distanceMatrix avoids using loops, thus is very fast.
We have updated the code and the document. The code now generates exactly the same results as shown in the document. I am sorry for the confusion in previous versions of this package. The current version has lots of significant improvements.