Info

この質問は閉じられています。 編集または回答するには再度開いてください。

analyzing sequential files efficiently

1 回表示 (過去 30 日間)
cgo
cgo 2015 年 12 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have 500 sequential files whose filename is in the form "datafile_XX.mat". Each file contains an n by 8 matrix where n varies per file. But all files have 8 columns, only the number of rows varies.
I want to get the average of the first 4 columns of all rows of all 500 files. How do I do it? Also, can you point to me a tutorial on these things?
If it helps, the files were created using 'sprintf'. Somehow there should be a reverse to this right?
Thanks
  2 件のコメント
Mohammad Abouali
Mohammad Abouali 2015 年 12 月 10 日
So are they MAT file or a text file? Sprintf doesn't create mat file!!! Could you upload two or three sample files?
Geoff Hayes
Geoff Hayes 2015 年 12 月 10 日
編集済み: Geoff Hayes 2015 年 12 月 10 日
I suspect it was meant that sprintf is used to create the file name
for k=1:500
filename = sprintf('datafile_%d.mat',k);
% do stuff
end
@cgo - you could use the above as a framework for reading (or loading) your files which would be part of the do stuff. What can you tell us about the contents of each file? Was the same named variable saved to each file?

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by