Trying to load .dat file matlab

2 ビュー (過去 30 日間)
Prateek Srivastava
Prateek Srivastava 2017 年 6 月 27 日
回答済み: Walter Roberson 2017 年 6 月 27 日
I am trying to use dlmread command for importing .dat file which has stress and strain values .strain values are in the range of -5.81E-09 but after giving filename='USt37.dat'; deliminator=','; data=dlmread(filename,deliminator,3,0); the data file is loading in 1x1 matrix form whereas original data was in 2x2 matrix form .Please help.
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 6 月 27 日
Please post a sample of the actual file, instead of just a picture of it.
One thing I notice is that your picture uses blanks between the columns, but you are using comma as the column delimiter.

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

採用された回答

Walter Roberson
Walter Roberson 2017 年 6 月 27 日
filename='USt37.dat';
fid = fopen(filename, 'rt');
data = cell2mat( textscan(fid, '%f%f', 'HeaderLines', 3, 'CollectOutput', 1) );
fclose(fid)

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by