Read the text files names are already in the table
조회 수: 1 (최근 30일)
이전 댓글 표시
bus gogen
2022년 8월 3일
답변: Constantino Carlos Reyes-Aldasoro
2022년 8월 5일
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1087215/image.png)
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.
댓글 수: 0
채택된 답변
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
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!