ex17ch3.m

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

M
16
字号
function sol = ex17ch3solinit = bvpinit(linspace(0,1,5),[0.5 0]);sol = bvp4c(@odes,@bcs,solinit);plot(sol.x,sol.y(1,:));fprintf('Other authors report y(0) = 0.63678, y(1) = 0.45759.\n');fprintf('Values computed are  y(0) = %7.5f, y(1) = %7.5f\n',...        sol.y(1,1),sol.y(1,end));%=================================================function dydx = odes(x,y)dydx = [ y(2)         y(2) + 2*y(1)^2 ];function res = bcs(ya,yb)res = [ ya(2) - (ya(1) - 1)        yb(2) ];

⌨️ 快捷键说明

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