The best way to understand it is by using the help or doc commands to look up each function name. At the top of each page you'll see a brief description of the function, inputs and outputs.
Here's a very general description of each line
[filename,pathname] = uigetfile('*.*','Choose the input image');
im = imread([pathname,filename]);
scale = 600/(max(size(im(:,:,1))));
im = imresize(im,scale*size(im(:,:,1)));
You can use imshow(im) to see the image.