필터 지우기
필터 지우기

Loading multiple .dat files

조회 수: 2 (최근 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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by