-1

I have this folders :

D:/ Houses/objects/*.jpg
D:/ Towers/objects/*.jpg
D:/ Hotels/objects/*.jpg
     .
     .  
     .
     .

The first folder have different name but inside those folders exists a folder that have the same name (objects) that contain different images in .jpg that i already know how to get them all.

The problem is the first folders have different names , so how can i go over those folders to get the .jpg in matlab, when they have different names and the name donĀ“t have the same prefix either ?

Thank you very much

Alejandro
  • 1
  • 1

1 Answers1

0

Use dir

files = dir('D:/*/objects/*.jpg');
fullPath = arrayfun(@(i) fullfile(files(i).folder, files(i).name), (1:length(files))', 'uni', 0);
user1543042
  • 3,225
  • 1
  • 13
  • 25