Loading multiple .dat files

15 ビュー (過去 30 日間)
Arijit De
Arijit De 2013 年 3 月 25 日
Hi,
I have a set of data consisting N no of files where each file is a column of N no of rows; all I need is to load the entire data column by column and construct a NxN square matrix. Each data file is saved as a .dat file and the Nth file has a name: filename_M_fileend.dat where M has N different values.
How I can construct the data matrix?
Thanks. Arijit

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 25 日
編集済み: Azzi Abdelmalek 2013 年 3 月 25 日
data=[];
for k=1:N
data=[data dlmread(sprintf('filename_%d_fileend.dat',k))]
end
  1 件のコメント
Arijit De
Arijit De 2013 年 3 月 30 日
Excellent, thanks a lot!!! -Arijit

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStandard File Formats についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by