从mathematica脚本导出数据

发布于 2024-12-29 01:41:38 字数 318 浏览 2 评论 0原文

我正在编写一个 mathematica 脚本并在 Linux 批处理 shell 中运行它。该脚本给出了一个数字列表作为结果。我想将此列表作为一个单列写入文件,不带大括号和逗号。为此,我尝试使用 Export 命令,

Export["file.txt", A1, "Table"] 

但收到错误:

Export::infer:无法推断文件 test1.txt 的格式

我尝试使用其他格式,但遇到了相同的错误。 有人可以告诉我出了什么问题以及我能做什么吗?预先致谢

I am writing a mathematica script and running it in the linux batch shell. The script gives as a result a list of numbers. I would like to write this list to a file as a one single column without the braces and commas. For this, I tried to use Export comand as

Export["file.txt", A1, "Table"] 

but I get the error:

Export::infer: Cannot infer format of file test1.txt

I tried with other format but i got the same error.
Could someone please tell what is wrong and what i can do? Thank beforehand

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

や三分注定 2025-01-05 01:41:38

这:

A1 = {1,2,3};
Export["test.tab", Transpose[{A1}], "Table"];

生成一个没有大括号和逗号的单列。

This:

A1 = {1,2,3};
Export["test.tab", Transpose[{A1}], "Table"];

produces a single column without braces and commas.

梦醒时光 2025-01-05 01:41:38

据我了解,您正在尝试导出表中的文件,为什么不尝试这样的事情,

Export["file.txt", A1, "Text"] 

From what I understand you are trying to export the file in TABLE, why don't you try something like this ,

Export["file.txt", A1, "Text"] 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文