Function Matlab二阶导数

Function Matlab二阶导数,function,matlab,derivative,Function,Matlab,Derivative,我遵循了上的教程,并准备了一个函数,如下所示: function dxy = diffxy(xy) % %split xy into variables in our equations % x = xy(1); xdot = xy(2); y = xy(3); % % define the derivatives of these variables from equations % xdot = xdot; ydot = 3*x + 2*y + 5; xdoubledot = 3 - ydo

我遵循了上的教程,并准备了一个函数,如下所示:

function dxy = diffxy(xy)
%
%split xy into variables in our equations
%
x = xy(1);
xdot = xy(2);
y = xy(3);
%
% define the derivatives of these variables from equations
%
xdot = xdot;
ydot = 3*x + 2*y + 5;
xdoubledot = 3 - ydot + 2*xdot;
%
%return the derivatives in dxy in the right order
%
dxy = [xdot; xdoubledot; ydot]
end
当我使用

[T, XY] = ode45('diffxy',0,10,[0 1 0])
我犯了一个错误

??? Error using ==> diffxy
Too many input arguments.
我也试过了

XY=ode45(@diffxy,[0 10],[0;1;0])


有人知道吗?

还没有读完整个教程,但是你不应该将函数定义为

function dxy = diffxy(t, xy)

其中,
t
是时间向量

没有阅读整个教程,但是您不应该将函数定义为

function dxy = diffxy(t, xy)
其中
t
是时间向量