WOLFRAM

Initialize[sym]

initializes the symbol sym from persistent values on the default persistence path.

Initialize[sym,{loc1,}]

initializes the symbol sym from persistent values on the persistence path {loc1,}.

Initialize["patt"]

initializes all variables matching the string pattern "patt".

Details and Options

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Set an initialization value for a variable:

Out[1]=1

Initialize the variable from the persistent value:

Out[3]=3

Scope  (1)Survey of the scope of standard use cases

Set initializations for two variables in a given context:

Initialize all variables in the given context:

Out[2]=2
Out[3]=3

Options  (1)Common values & functionality for each option

MergingFunction  (1)

Establish a default value and merging function for an initialization value:

Add an initialization value at the front end persistence location:

The resulting initialization value now uses the default merging function:

Out[3]=3

You can override the default merging function to use for an initialization:

Out[4]=4

Properties & Relations  (1)Properties of the function, and connections to other functions

Set an initialization value for a variable persisting for the current front end session:

Out[1]=1

Quit and restart the kernel:

Each newly started kernel will automatically invoke Initialize for all variables:

Out[3]=3

After quitting and restarting the front end, the initialization value is gone:

Out[4]=4
Wolfram Research (2017), Initialize, Wolfram Language function, https://reference.wolfram.com/language/ref/Initialize.html.
Wolfram Research (2017), Initialize, Wolfram Language function, https://reference.wolfram.com/language/ref/Initialize.html.

Text

Wolfram Research (2017), Initialize, Wolfram Language function, https://reference.wolfram.com/language/ref/Initialize.html.

Wolfram Research (2017), Initialize, Wolfram Language function, https://reference.wolfram.com/language/ref/Initialize.html.

CMS

Wolfram Language. 2017. "Initialize." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Initialize.html.

Wolfram Language. 2017. "Initialize." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Initialize.html.

APA

Wolfram Language. (2017). Initialize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Initialize.html

Wolfram Language. (2017). Initialize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Initialize.html

BibTeX

@misc{reference.wolfram_2025_initialize, author="Wolfram Research", title="{Initialize}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/Initialize.html}", note=[Accessed: 01-April-2025 ]}

@misc{reference.wolfram_2025_initialize, author="Wolfram Research", title="{Initialize}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/Initialize.html}", note=[Accessed: 01-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_initialize, organization={Wolfram Research}, title={Initialize}, year={2017}, url={https://reference.wolfram.com/language/ref/Initialize.html}, note=[Accessed: 01-April-2025 ]}

@online{reference.wolfram_2025_initialize, organization={Wolfram Research}, title={Initialize}, year={2017}, url={https://reference.wolfram.com/language/ref/Initialize.html}, note=[Accessed: 01-April-2025 ]}