InitializationCell

InitializationCell
is an option for Cell that specifies whether the cell should be tagged to be evaluated by the Wolfram Language kernel immediately before the first evaluation performed by the user after the notebook is opened.

DetailsDetails

  • Additional front end options determine the precise behavior of initialization cells when a notebook is opened.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Create and save a notebook that has an input cell marked as initialization:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input

Initialization cells are useful when you reopen the saved notebook:

In[3]:=
Click for copyable input

You can use Evaluation Evaluate Initialization Cells to evaluate initialization cells:

Or, when you evaluate any cell, the Wolfram System asks if you want to evaluate the initialization cells:

If you choose Yes, initialization cells are evaluated:

Close the notebook and delete the temporary file:

In[4]:=
Click for copyable input
Introduced in 1996
(3.0)