PRODUCTS
Products Overview
Mathematica
Mathematica for Students
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
Mathematica
Add-Ons
Wolfram|Alpha Products
SOLUTIONS
Solutions Overview
Engineering
Aerospace Engineering & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Materials Science
Mechanical Engineering
Operations Research
Optics
Petroleum Engineering
Biotechnology & Medicine
Bioinformatics
Medical Imaging
Finance, Statistics & Business Analysis
Actuarial Sciences
Data Analysis & Mining
Econometrics
Economics
Financial Engineering & Mathematics
Financial Risk Management
Statistics
Software Engineering & Content Delivery
Authoring & Publishing
Interface Development
Software Engineering
Web Development
Science
Astronomy
Biological Sciences
Chemistry
Environmental Sciences
Geosciences
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
Education
STEM Education Initiative
Higher Education
Community & Technical College Education
Primary & Secondary Education
Students
Technology
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
SUPPORT
Support Overview
Knowledge Base
Learning Center
Community & Forums
Training & Free Seminars
Does My Site Have a License?
Wolfram User Portal
COMPANY
About Wolfram Research
News & Events
Wolfram Blog
Partnerships
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
New to
Mathematica
?
Find your learning path
»
Mathematica
>
Core Language
>
Package Development
>
Options Management
>
OptionValue
>
BUILT-IN MATHEMATICA SYMBOL
Setting Up Functions with Optional Arguments
Manipulating Options
Tutorials »
|
OptionsPattern
Options
AbsoluteOptions
FilterRules
See Also »
|
Options Management
Package Development
New in 6.0: Core Language
More About »
OptionValue
OptionValue
[
name
]
gives the value of
name
in options matched by
OptionsPattern
.
OptionValue
gives the value of
name
for options associated with the head
f
.
OptionValue
extracts option values from the explicit list of rules
opts
.
MORE INFORMATION
OptionValue
gives explicit forms for default option values.
OptionValue
allows either
or
as specifications of default option values. Each head is treated as the list of rules obtained from
Options
.
OptionValue
uses the match for the first
OptionsPattern
object that appears as an argument of
f
.
OptionValue
[
name
]
is equivalent to
OptionValue
, where
f
is the head of the left-hand side of the transformation rule in which
OptionValue
[
name
]
appears.
OptionValue
and
OptionValue
[
name
]
always first use option values obtained from an explicit match for an
OptionsPattern
, then use defaults specified by
Options
[
f
]
.
OptionValue
[
f
,
opts
,
name
,
Hold
]
returns the option value with
Hold
wrapped around it.
OptionValue
[
Automatic
,
Automatic
,
name
,
Hold
]
is equivalent to
OptionValue
[
name
]
, except that the option value is returned with
Hold
wrapped around it.
EXAMPLES
CLOSE ALL
Basic Examples
(1)
Define default option values for the function
:
Define
, allowing options to be given:
Use
with an explicit option setting:
Use
with options taken to have their default values:
Define default option values for the function
:
In[1]:=
Define
, allowing options to be given:
In[2]:=
Use
with an explicit option setting:
In[3]:=
Out[3]=
Use
with options taken to have their default values:
In[4]:=
Out[4]=
SEE ALSO
OptionsPattern
Options
AbsoluteOptions
FilterRules
TUTORIALS
Setting Up Functions with Optional Arguments
Manipulating Options
MORE ABOUT
Options Management
Package Development
New in 6.0: Core Language
New in 6