Mathematica 中的批量输入和输出? [英] Batch input and output in Mathematica?

查看:73
本文介绍了Mathematica 中的批量输入和输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我发现了一些旧帖子 在 MathGroup 上,其中显示了未记录的命令行选项 -batchinput-batchoutput 的用法:

Recently I found some old post on MathGroup where usage of undocumented command-line options -batchinput and -batchoutput is shown:

 If test.mma contains the following commands:

    a=2+2
    b=10!;
    a+b

 then, running Mathematica in batch mode, only output for the first and 
 third commands goes to stdout:

    # math -batchinput -batchoutput < test.mma

    4

    3628804

但是当尝试在 Windows 下重现此行为时,我只在控制台窗口中打印了第一个输出.我做错了什么?

But when trying to reproduce this behavior under Windows I get only first output printed in the console window. What am I doing wrong?

推荐答案

我测试了它并得到了两个数字作为输出.然而,如果最后一个命令后面没有回车,输出就是你发布的内容!

I tested it and got both numbers as output. HOWEVER, if the last command is not followed by a carriage return, the output is exactly what you posted!

因此,请检查您的最后一行是否以回车结束.

So, please check that you are ending your last line with a carriage return.

这篇关于Mathematica 中的批量输入和输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆