Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: extract dynamically the headerlines row numvber by string/number
Date: Tue, 1 Jul 2008 09:35:08 +0000 (UTC)
Organization: Inst of Thermomechanics AS CR
Lines: 37
Message-ID: <g4ctoc$5lj$1@fred.mathworks.com>
References: <2924bec5-2274-4b3b-8354-20b34f59add2@m3g2000hsc.googlegroups.com>  <155421db-2dae-4c05-a69a-7bd91a8f6793@r66g2000hsg.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1214904908 5811 172.30.248.38 (1 Jul 2008 09:35:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 1 Jul 2008 09:35:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 79193
Xref: news.mathworks.com comp.soft-sys.matlab:476824



Engeltje <Engeltje81@gmail.com> wrote in message
<155421db-2dae-4c05-a69a-7bd91a8f6793@r66g2000hsg.googlegroups.com>...
:
SNIP
:
> Now I actually have a new problem!
> I have some data in which part of the colomn is emtpy.
> Example:
> 
> timestamp X Y value
> 10
> 20 3.2 3.4 4
> 30
> 40 1.2 2.7 10
> 
> I use:
> values=textscan(filename,'%d %f %f %d', 4,'headerlines',1);
> 
> [TS,GazePointX,GazePointY,val]=values{:}
> 
> the problem is that it stops at TS=10, and the others are
empty
> Can u help me?
> angelo

Hi Angelo,

I think that you have to use another approach to it, and
read the file line by line. Look at 
help fgetl and
help fgets.
after getting a line contents you may analyze it by function
sscanf 
and decide what to do with half-empty line.

Mira