How to implement a for cycle to run a sequence of text files with the system command

Hi,
I would like to open a sequence of files by combining a for cycle and a list of files to open. How can I do that? I attach a sample list, that I plan to use as an input.
I thank you in advance.

Answers (1)

Here's one way:
fid = fopen('system_TXT.txt');
while ~feof(fid)
file_name = fgetl(fid);
% process file file_name
end
fclose(fid);

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Release

R2022b

Tags

Asked:

on 17 Jul 2023

Commented:

on 15 Aug 2023

Community Treasure Hunt

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

Start Hunting!