MATLAB: How to process all image in directory

digital image processing

i want to process all of RGB image in directory to binary image, and i want to save the result in image type. how to process all image and then save the result in image type after the process ? thanks