📄 bvptest.asv
字号:
% function bvptest
solinit = bvpinit([0 1 2 3 4],[1; 0]);
sol = bvp4c(@twoode, @twobc, solinit);
xint = linspace(0, 4, 50);
yint = deval(sol, xint);
plot(xint, yint(1,:),'b');
xlabel('x')
ylabel('solution y')
% hold on
%%
% This particular boundary value problem has exactly two solutions. The other
% solution is obtained for an initial guess of
%
% y(x) = -1, y'(x) = 0
%
% and plotted as before.
figure
hold on
solinit = bvpinit([0 1 2 3 4],[100; 0]);
sol = bvp4c(@twoode,@twobc,solinit);
xint = linspace(0,4,50);
yint = deval(sol,xint);
plot(xint,yint(1,:),'r');
legend('sol','solinit')
title('BVP')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -