How to loop 100 txt files through a folder
Show older comments
Hi, I am completely new to matlab. I need help to load 100 txtfiles from one folder into matlab to extract features. Can I please know the step by step code to use to loop them using batch files?
2 Comments
Bikram Kawan
on 16 Jul 2015
matFiles = dir('*.txt');
numfiles = length(txtfiles);
disp(numfiles)
mydata = cell(1, numfiles);
for k = 1:numfiles
mydata{k} = load(matFiles(k).name);
dataset=mydata{1,k};
disp(k)
%You other code to execute in this block
end
jahmunah vicnesh
on 17 Jul 2015
Answers (1)
Azzi Abdelmalek
on 16 Jul 2015
0 votes
3 Comments
jahmunah vicnesh
on 17 Jul 2015
Walter Roberson
on 17 Jul 2015
Bikram Kawan's reply shows looping and loading data.
jahmunah vicnesh
on 17 Jul 2015
Edited: Stephen23
on 17 Jul 2015
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!