필터 지우기
필터 지우기

Mismatch between file and format character vector.

조회 수: 4 (최근 30일)
Ishaq Alshuaili
Ishaq Alshuaili 2021년 2월 17일
댓글: Ishaq Alshuaili 2021년 2월 21일
why I get this error:
Mismatch between file and format character vector.
Trouble reading 'Numeric' field from file (row number 2, field number 1) ==>
,0.009381993674,0.0067125028,0.007985085249,0.003736027749,0.009879481979,0.004188054241,0.004999999888\n

답변 (1개)

Walter Roberson
Walter Roberson 2021년 2월 17일
The implication of the message is that you asked to skip the first row of the file and it did that, and then that the first thing it found in the second row was a comma when it expected a number.
If you always want to skip the first field of each row then where you used 1,0 in the call, use 1,1 . The first number is the number of rows to skip, and the second number is the number of columns to skip on each row.
If some of your lines start with commas and others do not, but you want to read the numbers if they are present, then use readtable() or readmatrix() or textscan() instead of dlmread(). dlmread() is implemented as a call to textscan() but does not support the options you need to deal with missing data.

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by