|
SOLUTIONS
|
MATHEMATICA 内置符号
OptionValue
OptionValue[name]
给出选项 name 的值,该选项设置与 OptionsPattern 匹配.
OptionValue[f, name]
给出具有头部 f 的选项 name 的值.
OptionValue[f, opts, name]
从规则 opts 的列表中提取选项值.
更多信息更多信息
- OptionValue[{opt1->val1, ...}, ...] 明确指明缺省选项的设置.
- OptionValue[{spec1, spec2, ...}, ...] 允许使用
或
的形式来设定缺省选项值. 每个头部可以作为 Options[fi] 中的规则列表来处理. - OptionValue[f, name] 用第一个匹配 OptionsPattern 对象作为 f 的自变量.
- OptionValue[name] 等价于 OptionValue[f, name],其中 f 是 OptionValue[name] 中转换规则左边的头部.
- OptionValue[f, name] 和 OptionValue[name] 通常首先使用在 OptionsPattern 中的选项设置,然后使用 Options[f] 指定的缺省值.
- OptionValue[f, opts, name, Hold] 返回应用 Hold 的选项值.
- OptionValue[Automatic, Automatic, name, Hold] 等价于 OptionValue[name],除了应用 Hold 的选项值.
版本 6 的新功能
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
