how to compute the number of image from subfolder ?

Illustration
Emmettsmith - 2020-09-29T11:58:21+00:00
Question: how to compute the number of image from subfolder ?

hello every one i want to compute the number of images from image dataset witch have many subfolder d = dir(fullfile(('.\databasee\'))) num =length(d) witch databasee it's the folder that contain many subfolder of images when i run the code it doesn't give me the number of imges

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

fullfile(('.\databasee\')) is exactly the same as its input: '.\databasee\'. The unnecessary parentheses are confusing only.
 
To get all .jpg images in subfolders:
 
d = dir('.\databasee\**\*.jpg');
num = numel(d)


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!