How do i read all the files in a folder?
469 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Elias Unk
le 22 Juil 2018
Commenté : KALYAN ACHARJYA
le 22 Juil 2018
i want something like:
folder = path_to_folder
an For element in folder:
print(element)
where i get all the files names, in reality they will be a function instead of print applied.
0 commentaires
Réponse acceptée
KALYAN ACHARJYA
le 22 Juil 2018
Modifié(e) : KALYAN ACHARJYA
le 22 Juil 2018
% Please save all files name in symmetrically before doing the operation
% names for example f1,f2,f3...
%Save the folder of files in the current directory
path_directory='folder_name_here';
% Pls note the format of files,change it as required
original_files=dir([path_directory '/*.file_extention_format']);
for k=1:length(original_files)
filename=[path_directory '/' original_files(k).name];
file-load statement here % Load file
% Next do your operation and finding
end
5 commentaires
KALYAN ACHARJYA
le 22 Juil 2018
Walter Robinson sir gave the answer. I am tiny being wrt Walter sir. He is a genius in Matlab. Rank 1
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Search Path dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!