MatLab script for images categorization