Path: news.mathworks.com!not-for-mail
From: "Zahra" <zahra.yamani@nrc.gc.ca>
Newsgroups: comp.soft-sys.matlab
Subject: Re: txt2mat
Date: Mon, 10 Nov 2008 23:54:01 +0000 (UTC)
Organization: National Research Council of Canada
Lines: 53
Message-ID: <gfahip$crc$1@fred.mathworks.com>
References: <gf9ogb$mrb$1@fred.mathworks.com> <gfa9t6$dig$1@fred.mathworks.com>
Reply-To: "Zahra" <zahra.yamani@nrc.gc.ca>
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 1226361241 13164 172.30.248.37 (10 Nov 2008 23:54:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 10 Nov 2008 23:54:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1060562
Xref: news.mathworks.com comp.soft-sys.matlab:500114


Hi Mira,

Thanks for your reply.

The code you sent workd if there is no other headerlines in the file. In my case, the actual data files have teh follwoing format:

-----------------------------------
header1

Point v1 v2 v3 v4 
Point v5 v6 
  1 -73 -112 15000 61 
  1 79 79 
  2 -74 -112 25000 61 
  2 72 74




header2

Point v1 v2 v3 v4 
Point v5 v6 
  1 -73 -112 15000 61 
  1 79 79 
  2 -74 -112 25000 61 
  2 72 74




header3

Point v1 v2 v3 v4 
Point v5 v6 
  1 -73 -112 15000 61 
  1 79 79 
  2 -74 -112 25000 61 
  2 72 74

----------------------------------------------

With this format, when I try your code, I get the follwoing error:

??? Conversion to cell from double is not possible.

Error in ==> ffread at 142
            data(k) = sscanf(st_(nc_:J_(j_)-1),'%e');

Any further advice is greatly appreciated.

Thanks,
Zahra