Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: Export Import Array
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
graser

Posts: 16
Registered: 5/9/09
Export Import Array
Posted: Jul 17, 2013 1:45 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear Mathematica Users!

I have a question for you about Exporting and Importing array.
Let's say there is a array (or vector) like,
vectors =
Table[{x, y, z}, {x, -1, 1, .25}, {y, -1, 1, .25}, {z, -1, 1, .25}];

If I export vectors as "XLS" format and import the XLS file,
TT= Import["vector.xls", "XLS"];

Some funny thing happen like
TT[[1, 1, 1]] should be {-1,-1,-1} so that If I do TT[[1, 1, 1,1]] , it should give -1.

But instead of that, TT[[1, 1, 1]] gives a string as "{-1., -1., -1.}" .

If I export vectors as "Table" format and import the table file,
TR= Import["vector.data", "Table"];
It gives something like.. {"{{-1.,", "-1.,", "-1.},",.... All double comma.


Do you know how to properly export vector (or array) ?

And if I import string instead of vecotor like TT, How to convert TT like string to array?
"{-1., -1., -1.}" -> {-1,-1,-1}

Thanks!






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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.