MATLAB: Calculate number of images

calculatedirectoryimagesnumber

d = dir('*.bmp');
n = length(d);
i have a folder and i am calculating number of images in that folder, but it calculates only .bmp images.. Some times there will be png images also.. But whenever there will be images it will be of same extension. So, i want to make general code.. Whatever the images, it should calculate..
so, what should be the change in first line of code, if there are png images..?

Best Answer

d = dir('*.bmp')