ex25ch2.m

来自「these codes are for solving OED with mat」· M 代码 · 共 14 行

M
14
字号
function ex25ch2options = odeset('Events',@event,'RelTol',1e-5,'AbsTol',1e-10);[t,y,te,ye,ie] = ode45(@odes,[0 20*pi],[0; 1],options);plot(t,y(:,1),te,ye(:,1),'ro')spacing = diff(te)%=================================================function dydt = odes(t,y)dydt = [y(2); -sin(y(1))];function [value,isterminal,direction] = event(t,y)isterminal = 0;direction = 0;value = y(1);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?