Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to expert a matrix in matrix market format

20 views
Skip to first unread message

pratip

unread,
Aug 27, 2010, 4:06:19 AM8/27/10
to
Dear Group,

Can some one tell me how to export a matrix containing numerical
values in a matrixmarket file.
It is called .mtx format. mathematica documentation supports it but I
cant export using the export command.
Also how to import .mtx files in mathematica.

In general the import export documentation of mathematica does not
have much examples and for several format almost no documentation. I
hope this will improve in the next versions.

regards,

pratip

Bill Rowe

unread,
Aug 28, 2010, 7:03:38 AM8/28/10
to
On 8/27/10 at 4:06 AM, pratip.ch...@gmail.com (pratip) wrote:

>Dear Group,
>
>Can some one tell me how to export a matrix containing numerical
>values in a matrixmarket file. It is called .mtx format. mathematica
>documentation supports it but I cant export using the export
>command. Also how to import .mtx files in mathematica.

To Export:

Export["test", RandomReal[1, {5, 5}], "MTX"]

To Import:

Import["test", "MTX"]

For more information about Export/Import in matrixmarket format goto:

ref/format/MTX

in the Documentation Center


Sjoerd C. de Vries

unread,
Aug 28, 2010, 7:03:59 AM8/28/10
to
Dear pratip,

It really doesn't seem to be that difficult. Just typing

Export[ "C:\\Documents and Settings\\Sjoerd\\Desktop\\Ape.mtx", {{0.,
3.}, {5., 0.}}]

generates an mtx file on my desktop. All I needed was actually in the
documentation and was easy to find (that's not always the case, but
here it was).

Relevant doc pages:
- ref/format/MTX
- Export

Cheers -- Sjoerd

0 new messages