Read batch data files

5 ビュー (過去 30 日間)
Luciano Magrini
Luciano Magrini 2015 年 10 月 16 日
コメント済み: Thorsten 2015 年 10 月 19 日
I need to read more than one set of matrices 200. How can I automate the process of reading these matrices? The files are named in ascending order.
Thank you.

採用された回答

Thorsten
Thorsten 2015 年 10 月 16 日
Use dir to get the names of the files and then use a for loop to process the files.
  2 件のコメント
Luciano Magrini
Luciano Magrini 2015 年 10 月 16 日
Thanks for the answer.
I managed to read the directory, but could not mount the loop. Can you help me again? The files have the following name:
"hmi.m_45s.001_TAI.magnetogram.fits.dat" with variations "002", "003", .... until "296".
How can I mount the loop for this structure? I'm struggling because the file names are not just numbers. = /
I thank you again.
Thorsten
Thorsten 2015 年 10 月 19 日
d = dir('*TAI.magnetogram.fits.dat')
for i = 1:numel(d)
filename = d(i).name
% read filename and process data
end

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTransfer Function Models についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by