How do i read all the files in a folder?

조회 수: 423 (최근 30일)
Elias Unk
Elias Unk 2018년 7월 22일
댓글: KALYAN ACHARJYA 2018년 7월 22일
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.

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 22일
편집: KALYAN ACHARJYA 2018년 7월 22일
% 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
Elias Unk
Elias Unk 2018년 7월 22일
Kindly check this question https://www.mathworks.com/matlabcentral/answers/411504-how-to-cat-my-dataset to see why i need it and see if you can help me adjust it.
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 22일
Walter Robinson sir gave the answer. I am tiny being wrt Walter sir. He is a genius in Matlab. Rank 1

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by