Mismatch between file and format character vector.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 17 de Feb. de 2021
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.
Ver también
Categorías
Más información sobre Text Files en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!