It won't help in your understanding by explaining line-by-line. Try running the command in Matlab workspace and utilize the plot/imshow etc to display the changes for each step. You will be able to understand how the code work and learn Matlab at the same time. For concepts learning, search related literature.
Hi Muhammad Imran,
"modelName" is the name of a variable. Author provided model1Hist.mat as training data (generate own training data using getImageHists.m). Refer to documentation on how to properly run the command. For example,
searchImageHist('beach.JPG','model1Hist',5);
Addition to ampire Ê (20 May 2009), can provide user with flexibility to select any directory (with images) by adding one line after the function name.