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,