The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to output matrix to file
Replies: 1   Last Post: May 31, 1997 3:29 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
H.J. Wang

Posts: 12
Registered: 12/7/04
Re: How to output matrix to file
Posted: May 31, 1997 3:29 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

David Brienza wrote:
> How can I export a 2D matrix to a tab delimited text file? I've tried:
> OutputForm[datamatrix] >> datafile.dat
> Which gives me files with unwanted linefeeds in the middle of the rows. I

> -Dave Brienza

Try the following:

define = OpenWrite[ savefilename,FormatType->OutputForm,
Write[ define, TableForm[ dataset, TableSpacing->{0} ] ] ;
Close[ define];

If the matrix has many columns, the PageWidth->Infinity makes sure the
rows of the matrix won't be wrapped in the output.

Hope it helps.

H.J. Wang

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.