Path: news.mathworks.com!not-for-mail
From: "Luca Zanotti Fragonara" <Luca_Zanotti@libero.it>
Newsgroups: comp.soft-sys.matlab
Subject: Re: problems using textread
Date: Tue, 18 Nov 2008 21:40:20 +0000 (UTC)
Organization: Politechnic of Turin
Lines: 16
Message-ID: <gfvco4$ke0$1@fred.mathworks.com>
References: <gfv9m2$968$1@fred.mathworks.com> <gfva6u$grj$1@fred.mathworks.com>
Reply-To: "Luca Zanotti Fragonara" <Luca_Zanotti@libero.it>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227044420 20928 172.30.248.37 (18 Nov 2008 21:40:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 18 Nov 2008 21:40:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1429161
Xref: news.mathworks.com comp.soft-sys.matlab:501583


Sorry, I've posted 2 times, and this is the third. But I've posted a wrong code. I've written textread, while I was thinking at textscan. So the correct code is:
fin=fopen('filename','rt')
A=textscan(fin,'%f %f %f %f %f %f %f','endofline','\n','Headerlines',number);
fclose(fin);
CD=A{3}(:,1);

"Luca Zanotti Fragonara" <Luca_Zanotti@libero.it> wrote in message <gfva6u$grj$1@fred.mathworks.com>...
> fin=fopen('filename','rt')
> A=textread(fin,'%f %f %f %f %f %f %f','endofline','\n','Headerlines',number);
> fclose(fin);
> where number is the number of the row where you want to start to read the file.
> in A{3} you have your Cd, so
> CD=A{3}(:,1);
>