Difference between revisions of "Mathematica/Note"
(Created page with "Note that in batch mode, Mathematica notebooks can not be used, because the Mathematica kernel expects a plain text file with Mathematica commands. These plain text files are...") 
(No difference)

Revision as of 06:20, 25 August 2016
Note that in batch mode, Mathematica notebooks can not be used, because the Mathematica kernel expects a plain text file with Mathematica commands. These plain text files are called script file and their name ends with .m (for instance input.m). The output has then to be redirected to an output file. In interactive mode, you type an expression, and the result is immediately displayed on your screen. In batch mode you have ensure that Mathematica writes labels and results to your output file. Therefore you need to assign your expression to a variable and use afterwards the Print[] command.
a = ... [expression] ... Print["a = "]</code> > prints a label Print[a]</code> > prints the value of a
You can also use graphical commands as Plot or Display in the batch mode. This is discussed below, but first it is explained, how to use Mathematica in batch mode, when no graphical commands are involved.