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

조회 수: 7 (최근 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 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