If you can upgrade to a later version (R2015a or higher), you can use the'CustomExtractor' name-value pair to do this. Unfortunately, this wasn't part of R2014b.
Put your call to match() in the middle of a for loop like is given in the FAQ:http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F The FAQ will show you how to "import the database of images" assuming that your database is just a collection of files in a folder, and not a true database like Oracle or something.
Best Answer