how to read .data format data using matlab code??

4 ビュー (過去 30 日間)
Gayathri varu
Gayathri varu 2016 年 5 月 3 日
コメント済み: Jan 2016 年 5 月 6 日
for example the file contains 4,43,1,1,?,1 this type format.i attached data file.please help how to read the data file

回答 (1 件)

Jan
Jan 2016 年 5 月 3 日
編集済み: Jan 2016 年 5 月 6 日
Str = fileread(FileName);
Str = strrep(Str, '?', 'NaN'); % EDITED, "Str, " inserted
Str = strrep(Str, char(10), ',');
Value = sscanf(Str, '%f,');
Value = reshape(Value, 5, []).';
  2 件のコメント
Gayathri varu
Gayathri varu 2016 年 5 月 4 日
sir,i try this the error occured.the error type is not enough input argument.
Jan
Jan 2016 年 5 月 6 日
Yes, there have been some typos. They are fixed now.

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

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by