MATLAB: Opening all .txt files in a folder and importing/saving columns of data separately which may be called upon and graphed.

import .txt filesimport all data in folderimport all data in...keep data in columsloop opening filesMATLABopenfolder

Attached you will find code of the things that I have tried. I am having issues with the importing of the data. When I read from a single individual .txt file my code works but I am having issues implementing a way to do this with all .txt files in a folder. I have run impedance spectrums for neural cuffs and need to find a way to graph each working electrode in each cuff, in each medium, with three trials. Any help would be so appreciated.

Best Answer

files = dir('*.txt') ; % you are in the folder of files
N = length(files) ;
% loop for each file
for i = 1:N
thisfile = files(i).name ;
% do what you want
end
Related Question