📄 ex22ch3.m
字号:
function ex22ch3clf resethold onfor i = 1:3 infinity = 5*i; if i == 1 solinit = bvpinit(linspace(0,infinity,5),[pi 0]); else solinit = bvpinit(sol,[0,infinity]); end sol = bvp4c(@odes,@bcs,solinit); plot(sol.x,sol.y(1,:),sol.x(end),sol.y(1,end),'ro'); axis([0 15 0 4]); drawnowendhold offfprintf('Initial slope of 2 is approximated by %g.\n',sol.y(2,1));%===========================================================function dydz = odes(z,y)dydz = [ y(2); -sin(y(1)) ];function res = bcs(ya,yb)res = [ ya(1); yb(1)-pi ];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -