taking the average of data from 500 different files

1 Ansicht (letzte 30 Tage)
cgo
cgo am 11 Dez. 2015
Beantwortet: the cyclist am 11 Dez. 2015
Hi,
I have 500 different files in sequential filenames in the following format: datafile_XX.mat
All of these files contain a matrix that is of size n x 8. n is changing per file. but there are 8 columns total.
I want to take the average of the first 400 rows of each file. How do i load all of these files efficiently?

Akzeptierte Antwort

the cyclist
the cyclist am 11 Dez. 2015
for ni = 1:500
filename = sprintf('datafile_%03i.mat',ni);
load(filename)
% Process your stuff here
end

Weitere Antworten (0)

Kategorien

Mehr zu Structures finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by