Read the text files names are already in the table

1 回表示 (過去 30 日間)
bus gogen
bus gogen 2022 年 8 月 3 日
I want to open these text files and their names are tabulated inside a table matrix. They have one column which includes integers. Can I use for loop? because I need to do it for 20 different folders which means 140 different names so I want to read them in matlab without knowing their names.

採用された回答

Constantino Carlos Reyes-Aldasoro
Constantino Carlos Reyes-Aldasoro 2022 年 8 月 5 日
If they are inside a folder, you could read the files in the folder and then loop over those files.
If you have the names and the names are a combination of letters and numbers (RSN4455, RSN4456, RSN4457) and you have the numbers you can concatenate in a for loop, e.g.
for k = 4455:4460
filename = strcat('RSN',num2str(k))
% here you load the file name
end
filename = 'RSN4455'
filename = 'RSN4456'
filename = 'RSN4457'
filename = 'RSN4458'
filename = 'RSN4459'
filename = 'RSN4460'

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by