Clear Filters
Clear Filters

hi there can anyone help me, i have problem in reading the excel file using the csvread command

2 views (last 30 days)
  4 Comments
dpb
dpb on 21 Nov 2021
Also recommend using readtable or one of the other more recent input functions instead of csvread
If the file contains anything other than numeric values, csvread is guaranteed to fail -- at most you can skip a header line, but it isn't smart enough to do that on its own.
Also, much easier for folks here if you paste the actual text instead of images and attachments -- if you're going to attach anything it would be more useful to have the input file so we could see its content.
Walter Roberson
Walter Roberson on 22 Nov 2021
If you know ahead of time what the file format is like, then csvread() can be used to skip any fixed number of leading rows, and any fixed number of leading entries, even when those rows or entries contain text. However, csvread() cannot be used to skip trailing rows or trailing or intermediate text columns.

Sign in to comment.

Answers (1)

Prateek Rai
Prateek Rai on 24 Nov 2021
Hi,
Using "csvread" to read comma-separated value (CSV) file is not recommended.Use "readmatrix" instead.
You can refer to readmatrix MathWorks documentation page to find more on this.

Community Treasure Hunt

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

Start Hunting!