MATLAB 帮助中心
提取 ODE 选项值
v = odeget(options,"Name")
v = odeget(options,"Name",default)
v = odeget(options,"Name") 从 options(包含选项值的结构体)中提取指定选项的值。使用 odeset 创建或更新 options 结构体。
options
Name
odeset
示例
如果指定选项的值没有在 options 中指定,v = odeget(options,"Name",default) 将返回值 v = default。
default
v = default
全部折叠
使用 odeset 创建一个 options 结构体,其中包含几个不同选项的值。
M = @(t) [t 0; 0 -t]; options = odeset(RelTol=1e-4,AbsTol=1e-5,OutputFcn=@odephas2,... Mass=M,MassSingular="no",MStateDependence="none")
options = struct with fields: AbsTol: 1.0000e-05 BDF: [] Events: [] InitialStep: [] Jacobian: [] JConstant: [] JPattern: [] Mass: @(t)[t,0;0,-t] MassSingular: 'no' MaxOrder: [] MaxStep: [] MinStep: [] NonNegative: [] NormControl: [] OutputFcn: @odephas2 OutputSel: [] Refine: [] RelTol: 1.0000e-04 Stats: [] Vectorized: [] MStateDependence: 'none' MvPattern: [] InitialSlope: []
使用 odeget 从 options 结构体中提取 OutputFcn 字段的值。
odeget
OutputFcn
v = odeget(options,"OutputFcn")
v = function_handle with value: @odephas2
现在提取 Refine 字段的值。由于未设置此字段,odeget 返回空矩阵 []。
Refine
[]
v = odeget(options,"Refine")
v = []
您可以为 odeget 指定第三个输入,以更改默认返回值。这样可以确保 v 永远非空。
v
v = odeget(options,Refine=1)
v = 1
Options 结构体。使用 odeset 创建或修改 options 结构体。
示例: options = odeset(RelTol=1e-4,AbsTol=1e-5) 返回指定了相对和绝对误差容限值的 options 结构体。
options = odeset(RelTol=1e-4,AbsTol=1e-5)
数据类型: struct
struct
选项名称,指定为 odeset 接受的任何有效选项:
误差控制 - "AbsTol"、"RelTol"、"NormControl"
"AbsTol"
"RelTol"
"NormControl"
输出控制 - "NonNegative"、"OutputFcn"、"OutputSel"、"Refine"、"Stats"
"NonNegative"
"OutputFcn"
"OutputSel"
"Refine"
"Stats"
求解器步长 - "InitialStep"、"MaxStep"、"MinStep"
"InitialStep"
"MaxStep"
"MinStep"
事件函数 - "Events"
"Events"
雅可比矩阵 - "Jacobian"、"JPattern"、"Vectorized"
"Jacobian"
"JPattern"
"Vectorized"
质量矩阵 - "Mass"、"MStateDependence"、"MvPattern"、"MassSingular"、"InitialSlope"
"Mass"
"MStateDependence"
"MvPattern"
"MassSingular"
"InitialSlope"
ode15s 和 ode15i 的算法选项 - "MaxOrder"、"BDF"
ode15s
ode15i
"MaxOrder"
"BDF"
示例: v = odeget(options,"AbsTol")
v = odeget(options,"AbsTol")
数据类型: char | string
char
string
默认返回值,指定为任何有效的 MATLAB 对象。
示例: 如果 options 不包含为 AbsTol 设置的值,v = odeget(options,AbsTol=1e-6) 将返回 1e-6。
AbsTol
v = odeget(options,AbsTol=1e-6)
1e-6
数据类型: s | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char | struct | table | cell | function_handle | categorical
s
single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
logical
table
cell
function_handle
categorical
全部展开
用法说明和限制:
name 参量必须为常量。
name
backgroundPool
ThreadPool
在 R2006a 之前推出
odeset | odextend | deval
odextend
deval
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处