how to use fscanf in matrix

6 ビュー (過去 30 日間)
Skydriver
Skydriver 2020 年 5 月 7 日
編集済み: per isakson 2020 年 5 月 8 日
I have the coding like this:
file2='PDF_Repi_Mw_PGA_Amax.txt';
fid=fopen(file2, 'r');
PMP=fscanf(fid,'%g %g %g %g', [4,Inf])';
Repi=PMP(:,1); % Distance
Mw =PMP(:,2); % moment magnitude
PGA =PMP(:,3); % PGA at ground surface
amax=PMP(:,4); % peak ground surface acceleration
tha data contain every element has 178 row but I don't know the coding read the data only 112 row.
I don't know why? Any one can help. I would appreciate. Thx
  2 件のコメント
Sindar
Sindar 2020 年 5 月 7 日
try the import tool and see how it deals with the data. This should give you a hint to what's going wrong
Stephen23
Stephen23 2020 年 5 月 8 日
@Skydriver: please upload your sample file by clicking the paperclip button.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT Files についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by