MATLAB Answers

0

i had 200 .txt files each having four columns and 2000 rows . i want to import them into matlab and find average of each column .Please help me in coding this

Latest activity Commented on by KSSV
on 15 Oct 2016
Accepted Answer by KSSV
*

  0 Comments

Sign in to comment.

1 Answer

Answer by KSSV
on 13 Oct 2016
 Accepted Answer

d = dir('*.txt');
nfiles = length(d);
for k = 1:nfiles
data = importdata(d(k).name);
% get mean
end
Doc mean

  2 Comments

Thanks for the help but i am getting an error in import data statement " reference to non existent field Imageset1_001, which is name of the first.txt file
Check is d(i).name are matching with the files in the folder?

Sign in to comment.