Matlab sometimes does not support an certain image format. For instance Error reading bmp data Bitfield compression not supported.
This function imread_irfanview, uses the installed Irfanview application to convert the not-supported image file to a TIF file supported by Matlab.
Note, probably you have to change the PATH to the Irfanview application inside your code.
I = imread_irfanview('test.bmp');
%temp% replaced by getenv('temp')
Create scripts with code, output, and formatted text in a single executable document.