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

7 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by