problem reading a text data

1 回表示 (過去 30 日間)
Rica
Rica 2013 年 7 月 10 日
´hi all!
i have a big text file. Its form is :
32761 43718 0 0
10847 21163 0 0
22127 10953 0 0
21791 10780 0 0
44054 33255 0 0
32990 43895 0 0
i wrote this
fileID = fopen('data_0db.txt');
A=textscan(fileID,'%d %d %d %d ');
fclose(fileID)
the Proble are the Spaces btween some Rows. How could i eleminate the Spaces in matlab?
thank you all

採用された回答

Jan
Jan 2013 年 7 月 10 日
fileID = fopen('data_0db.txt');
A = fscanf(fileID,'%d', inf);
fclose(fileID)
A = reshape(A, 4, []).';

その他の回答 (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