필터 지우기
필터 지우기

Trouble reading number from file

조회 수: 8 (최근 30일)
Kris zenitis
Kris zenitis 2014년 7월 22일
답변: Azzi Abdelmalek 2014년 7월 22일
I am trying to read a txt file into an array. When I import the file mannually it opens normally into a desired 3000x10 matrix. When I am trying to user textread in order to import the data textread(data.txt) I am getting the following error:
Trouble reading number from file (row 1, field 2) ==> , 0.82477773784066744,
0.028192741339486998, 0
Error in ==> textread at 176
[varargout{1:nlhs}]=dataread('file',varargin{:});
  댓글 수: 3
Kris zenitis
Kris zenitis 2014년 7월 22일
0, 0.82477773784066744, 0.028192741339486998, 0.075278907139026061, 0, 0, 0, 0, 0, 0.034134401317307488
For example the above is the first line
Michael Haderlein
Michael Haderlein 2014년 7월 22일
I think dlmread is better suited for that file.

댓글을 달려면 로그인하십시오.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 7월 22일
data=importdata('filename.txt')

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by