1
$\begingroup$

I am trying to export a matrix in a file using Mathematica. I get the matrix and then use

Export["myfile.dat", MyMatrix, "???Format???"] 

There are many formats. I want the one that prints the matrix in this way:

{{0,1,0,....},{0,0,1,...},...} 

That is the classic Mathematica format....

How can I do this? Which one is the correct format?

2 Answers 2

2

Export["file.txt",MyMatrix,"String"] works in Mathematica 6

2

In really you can do this just with Put:

a = Table[RandomInteger[], {10}, {10}]; a >> "C:\\test.txt"