Running the Same code for Multiple Files in a Folder

5 Ansichten (letzte 30 Tage)
Sameer Sayyad
Sameer Sayyad am 17 Jun. 2021
Beantwortet: Chunru am 17 Jun. 2021
Is it possible to use the same code for Multiple Files in a Folder and save its output at particular location.

Antworten (1)

Chunru
Chunru am 17 Jun. 2021
Here is a schetch of the solution:
fn = dir('a*.txt'); % obtain the file information 'a*.txt'. make your own modification
for i=1:length(fn) % loop through all the selected files in the folder
filename = fn(i).name;
% Perform any operation depending on the filename
% Save the results anaywhere you like
end

Kategorien

Mehr zu Adding custom doc finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by