how do i display the total number of images ?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
arbab umair
le 23 Nov 2019
Commenté : arbab umair
le 24 Nov 2019
how can i show the result of total number of images that i have uploaded into matlab using loop?
a = imread('C:\Users\makov\Desktop\1\image1.jpg');
b = imread('C:\Users\makov\Desktop\1\image2.jpg');
c = imread('C:\Users\makov\Desktop\1\image3.jpg');
d = imread('C:\Users\makov\Desktop\2\image4.jpg');
e = imread('C:\Users\makov\Desktop\2\image5.jpg');
f = imread('C:\Users\makov\Desktop\2\image6.jpg');
g = imread('C:\Users\makov\Desktop\3\image7.jpg');
h = imread('C:\Users\makov\Desktop\3\image8.jpg');
i = imread('C:\Users\makov\Desktop\3\image9.jpg');
how can i show total number of images using loop method as they are in different folders.
0 commentaires
Réponse acceptée
Walter Roberson
le 23 Nov 2019
dinfo = dir('C:\Users\makov\Desktop\*\image*.jpg');
filenames = fullfile({dinfo.folder}, {dinfo.name});
numfiles = length(filenames);
rgbimages = cell(numfiles, 1);
for K = 1 : numfiles
rgbimages{K} = imread(filenames{K});
end
Number of files loaded is numfiles
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!