How do i read all the files in a folder?

95 ビュー (過去 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 Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by