how to compute the number of image from subfolder ?

E
Emmettsmith · Sep 29, 2020 · 2K views
Question
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 PhD Expert
Answered Aug 13, 2026
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)
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!