How to loop multiple text files with different filenames ?
显示 更早的评论
Hello,
I have multiple text files with different filenames like x001.txt, where x is varying from a-d. I have imported all the files. How to i loop them for reading the data from each of the text file. Thanks.
4 个评论
madhan ravi
2019-3-8
doc sprintf
Prajwal Kadlaplamutt Ravindra Kumar
2019-3-8
Mansa Murthy
2019-3-8
Hi..how to save extracted features of 100 images in one .mat file?
i want to save all the values (homogenity,contrast,energy) of 100 images in one .mat file?
回答(1 个)
KSSV
2019-3-8
files = dir('*.txt') ;
N = length(files) ;
for i = 1:N
thisfile = files(i).txt ;
% Do what you want
end
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!