dinex
dinex

Reputation: 377

Cannot use dlmread to read the whole tab-delimited file

I am still new to MATLAB. I am going to read a file containing lines with tab-delimited entries. Below is the example:

   3.000   3.000   3.000   3.000   3.000   3.000   3.000

The whole file is in this link. When I try using dlmread like this:

entry = dlmread(filepath,'\t',4,0);

It only reads 3294 instead of 125172 entries starting from the 5th line. Does anyone know how to fix it? Thanks!

Upvotes: 0

Views: 419

Answers (1)

Sardar Usama
Sardar Usama

Reputation: 19689

In the file you uploaded, there are 250344 entries, not 125172, starting from the 5th row to the end. dlmread(filepath,'',4,0); reads all of them. (3294*76=250344).

Why does \t not work here?
This is because the spaces in your file are not really tab spaces. Those are some simple spaces.

Upvotes: 4

Related Questions