Out

%n or Out[n]

is a global object that is assigned to be the value produced on the n^(th) output line.

%

gives the last result generated.

%%

gives the result before last. %%% (k times) gives the k^(th) previous result.

Details

  • Out[] is equivalent to %.
  • Out[-k] is equivalent to %%% (k times).

Examples

open allclose all

Basic Examples  (1)

Given a sequence of inputs:

Recall the outputs:

Scope  (2)

Add some integers:

Return the most recent and second most recent outputs using % and %%, respectively:

Refer to the second and third most recent outputs using the FullForm Out[-n]:

Multiply some integers:

Refer to the outputs using Out with explicit positive integer arguments:

Applications  (1)

Evaluate some expressions:

Evaluate DownValues for Out to see what outputs are stored:

Do the same by looking at Information for Out:

Properties & Relations  (5)

A combinations of n % signs is equivalent to Out[-n]:

The FullForm of % is Out[]:

Referencing an output number greater than the total number of outputs returns unevaluated:

If $HistoryLength is finite, only the $HistoryLength most recent values of Out will have a value:

The value of $Line corresponds to the numbers in In and Out:

Possible Issues  (1)

Out[-1] has no short InputForm:

However, both Out[-1] and Out[] (with InputForm %) refer to the most recent output:

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2024_out, author="Wolfram Research", title="{Out}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Out.html}", note=[Accessed: 15-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_out, organization={Wolfram Research}, title={Out}, year={1988}, url={https://reference.wolfram.com/language/ref/Out.html}, note=[Accessed: 15-January-2025 ]}