Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: textscan only reads first 1024 lines

$
0
0
On 8/8/2013 10:32 PM, Doug Schwarz wrote:
...

> textscan wants 1024 output variables, one for each column. Obviously,
> that's impractical, but you can use a cell array:
>
> c = cell(1,1024);
> [c{:}] = textscan(fid,repmat('%d',1,1024),'headerlines',...)
> data = [c{:}];
>

??? AFAIK, textscan() _ONLY_ ever uses a cell array and _NEVER_ "wants"
more than one output, Doug? Are you thinking the much-loved but
deprecated textread() instead?

I've wondered how OP resolved this; wondered if he were running into a
problem of an implicit record length limit in the file structure or it
wouldn't be the first bug found in textscan, either (altho the others
I've found have all had something to do w/ inconsistent field width
scanning vis a vis same format string as compared to _scanf(), not on a
general numeric field.)

--

Viewing all articles
Browse latest Browse all 19628

Trending Articles