odeeul.m
来自「Matlab学习课件」· M 代码 · 共 13 行
M
13 行
function [t,x,stats] = odeeul(func,dt,x0,options)
% Fixed step size euler integration
% Used only with discrete-time simulations, it takes one step from
% time 0 to dt and returns only the results at the end of the step.
%THIS IS NOT A GENERAL PURPOSE INTEGRATOR!
% 'dt' must be a scalar
xx0 =x0; % The dummy variable fixes a strange bug!?
xdot = feval(func,0,x0); % Get righthand side
x = xx0 + xdot * dt;
stats = 0; % To match the call to ode23; not used here
t = dt;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?