此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)
Mathematica HowTo
How to | Suppress the Output of a Computation
Often you need to perform intermediate steps in a calculation but have no need to see the results. By suppressing the output you save memory to store the notebook and may even save formatting time. You will also be able to see the important parts of the notebook more easily.
You can suppress output in Mathematica by placing a semicolon (;) at the end of the line:
For example, consider:
In[1]:=
Click for copyable input
Out[1]=
Suppress the output:
In[2]:=
Click for copyable input
    
This creates a small table of values and exports it to a text file. There is no point in seeing the numbers, so the result is suppressed:
In[3]:=
Click for copyable input
Out[3]=
    
You can also use ; to condense multiple lines into a single line. The output here is 2 since only the output of the last statement, b=2, is displayed:
In[4]:=
Click for copyable input
Out[4]=
Use ; at the end to stop any output:
In[5]:=
Click for copyable input
Using ; to chain commands extends to any number:
In[6]:=
Click for copyable input
Out[6]=