I’m working with an image retrieval system using color histogram intersection in MATLAB. This method gives me the following data: a real number which represents the histogram intersection distance, and the image file name. Because they are different data types, I store them in structure array with two fields, and then I save this structure in a .mat file. Now I need to sort this structure according to the histogram intersection distance in descending order in order to retrieve the image with the highest histogram intersection distance. I’ve tried many methods to sort this data but without result. Please can you help me solve this problem?
I’m working with an image retrieval system using color histogram intersection in MATLAB. This
Share
Here’s one example of how you could do this, using the function MAX instead of having to sort:
EDIT : If you would like to get the N highest values, and not just the maximum, you can use SORT instead of MAX (as Shaka suggested). For example (using the above structure):