Mismatch between file and format character vector.
조회 수: 4 (최근 30일)
이전 댓글 표시
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/522037/image.png)
댓글 수: 0
답변 (1개)
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 Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!