Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: writing to a .txt file question?
Date: Mon, 9 Jun 2008 22:13:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <g2k9td$83t$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1213049581 8317 172.30.248.37 (9 Jun 2008 22:13:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Jun 2008 22:13:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1376919
Xref: news.mathworks.com comp.soft-sys.matlab:472932



If I have a matrix 

a=magic(4)

    16     2     3    13
     5    11    10     8
     9     7     6    12
     4    14    15     1

Is it possible to write the matrix data to a *.txt file 
such that it would look like this:

    60
    16     2     3    13
     5    11    10     8
     9     7     6    12
     4    14    15     1
     carret return

basically, I need to add the number 60 on top of column 1, 
and a "carret return" after column 1?