Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How do I add header information to a matric when using the writng to file?
Date: Sat, 20 Jun 2009 19:27:01 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 11
Message-ID: <h1jd65$1oi$1@fred.mathworks.com>
References: <h1eu3g$i7q$1@fred.mathworks.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 1245526021 1810 172.30.248.38 (20 Jun 2009 19:27:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 20 Jun 2009 19:27:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:549172


"Jack " <use.text.after.underscore.only_jcannon@csu.edu.au> wrote in message <h1eu3g$i7q$1@fred.mathworks.com>...
> I have a 201 x 7 numerical matrix that I want to write to file. Format doesn't really matter provided I can open it in excel (csv is probablt best, but could be ASCII, text, dlm, etc). How do I add header information for each column to the matric when I write the file? Thanks.

If you write a CSV file, it will be fast, portable (non-windows) and simple:
fprintf(...,'field #1, field #2, ...');
fprintf(...,data)

You can also use dlmwrite for this

Yair Altman 
http://UndocumentedMatlab.com