Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!n2g2000hse.googlegroups.com!not-for-mail
From:  muhdzubair@gmail.com
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to read a particular line
Date: Sat, 07 Jul 2007 18:08:35 -0000
Organization: http://groups.google.com
Lines: 42
Message-ID: <1183831715.608443.62780@n2g2000hse.googlegroups.com>
References: <1183826686.296756.96900@57g2000hsv.googlegroups.com>
NNTP-Posting-Host: 80.6.89.170
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1183831715 29724 127.0.0.1 (7 Jul 2007 18:08:35 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 7 Jul 2007 18:08:35 +0000 (UTC)
In-Reply-To: <ef5cbda.0@webcrossing.raydaftYaTP>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 MPWBSRV
Complaints-To: groups-abuse@google.com
Injection-Info: n2g2000hse.googlegroups.com; posting-host=80.6.89.170;
Xref: news.mathworks.com comp.soft-sys.matlab:417753



On Jul 7, 6:42 pm, "per isakson" <p...@kth2.se> wrote:
> muhdzubair wrote:
>
> > Hi,
> > I want to read the 8th column from the file below:
>
> > 52.0 277 177 133 179 105 81 612999 320000
> > 147379
> > 154795 1238
> > 53.0 277 177 133 180 105 81 601314 317429
> > 146368
> > 153743 1232
> > 54.0 276 177 132 181 105 81 589799 314805
> > 145321
> > 152652 1227
> > 55.0 276 177 131 181 105 81 578469 312132
> > 144237
> > 151521 1221
>
> > I tried to use 'textscan' but couldnt get the result..can anyone
> > help
> > me to read the 8th column and sore in a variable for this
> > particular
> > case..
> > Thanks
>
> textscan( fid, '%*f%*f%*f%*f%*f%*f%*f%f%*f%*f%*f', ... )
>
> should do it / per- Hide quoted text -
>
> - Show quoted text -

I used textscan :
c=textscan(fid,'%*f %*f %*f %*f %*f %*f %*f %f');

but the output is:
c=
[18x1 double]

can i get the entire column as i have to get sum of all the four
numbers in the said column..