Mathematica中的批量输入和输出?

时间:2011-07-01 00:36:16

标签: wolfram-mathematica

最近我在MathGroup上找到了一些old post,其中显示了未记录的命令行选项-batchinput-batchoutput的使用情况:

 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下重现此行为时,我只在控制台窗口中打印出第一个输出。我做错了什么?

1 个答案:

答案 0 :(得分:7)

我测试了它并将两个数字作为输出。 HOWEVER ,如果最后一个命令后面没有回车符,那么输出就是你发布的内容!

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