Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / Programming / Debugging  /
TraceDepth

  • TraceDepth is an option for Trace and related functions which specifies the maximum nesting of evaluation chains that are to be included.
  • Setting TraceDepth -> n keeps only parts down to level n in nested lists generated by Trace.
  • By setting TraceDepth, you can make Trace and related functions skip over "inner" parts of a computation, making their operation more efficient.
  • See the Mathematica book: Section 2.5.10.
  • See also: TraceOff.

    Further Examples

    Here is the recursive definition of the Fibonacci numbers.

    In[1]:=

    Here are the end conditions for the recursion.

    In[2]:=

    Out[2]=

    This shows only steps that appear in lists nested at most three levels deep.

    In[3]:=

    Out[3]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.