textread does not read all rows

I am using textscan to read numerical values from a textfile with 8 header lines above 4 columns.
fid = fopen('free.txt');
V = textscan(fid,'%f%f%f%f','Headerlines','8');
The columns in the original textfile have 1278 rows whereas the cells in V have only 1230 rows.
Does anyone know a solution to this problem?

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 3 月 29 日

0 投票

textscan would stop reading if it encountered a position that could not be interpreted as a number. Check out lines 1238 and 1239 of the file.

カテゴリ

ヘルプ センター および File ExchangeText Data Preparation についてさらに検索

質問済み:

2011 年 3 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by