Hi there.
I have been using the function dlmread to read csv files, but recently I have been getting errors.
I would like to know if there is a good solution.

 채택된 답변

Star Strider
Star Strider 2021년 4월 22일

0 개 추천

Since .csv files are strictly numeric (although they can haved the first row as non-numeric headers), the files could have nonumeric fields that are causing problems. The easiest way to deal with this is probably to use the readcell function (introduced in R2019a) to read them.
That will load the contents into a cell array. It will then be possible for you to see the contents and can help you understand what the problem is. If the files have non-numeric headers, you can then choose to not read the first line, or to use other fucntions such as readtable to read them correctly.

댓글 수: 2

勇気 捧
勇気 捧 2021년 4월 23일
Thank you for your detailed answer.
I was able to read the file using the readcell function.
Star Strider
Star Strider 2021년 4월 23일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

질문:

2021년 4월 22일

댓글:

2021년 4월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by