|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
TraceScan
TraceScan[f, expr]
applies f to all expressions used in the evaluation of expr.
TraceScan[f, expr, form]
includes only those expressions which match form.
TraceScan[f, expr, s]
includes all evaluations which use transformation rules associated with the symbol s.
TraceScan[f, expr, form, fp]
applies f before evaluation and fp after evaluation to expressions used in the evaluation of expr.
ExamplesExamplesopen allclose all
Basic Examples (3)Basic Examples (3)
Print all expressions used for evaluation:
Count additions and multiplications of machine numbers needed for a numerical computation:
| In[1]:= |
| Out[1]= |
A recursive definition for finding Fibonacci numbers:
| In[1]:= |
| In[2]:= |
| Out[2]= |
Redefine
so that it saves results:
| In[3]:= |
| In[4]:= |
| Out[4]= |
The second time through it takes only one call since the value was saved:
| In[5]:= |
| Out[5]= |
New in 2
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
