Using Rules
Let's look at some examples of functions that return results in terms of rules. Solve finds the solutions to a polynomial equation of degree four or less (as well as some polynomial equations of higher degree). The solution is stated as a list of replacement rules.
We can get a list of the values for x by using ReplaceAll.
FindRoot, DSolve, and NSolve also return solutions in terms of replacement rules.
We can easily compute the absolute values of the roots.
What do the absolute values of the complex roots have in common?
The function DispersionReport, from the standard package Statistics`DescriptiveStatistics`, returns a list of statistics in the form of rules.
We can pick out a particular result or several results from the list.
Graphics options are specified in terms of rules.
Copyright © 2002 Wolfram Media, Inc. All
rights reserved. |