matlab ode23函数出错

本人MATLAB小白,求助微分方程求解:
函数定义:
function yp = ftest421(x,y)
yp=x.^2./y-x.*cos(y);

执行出错:
>> [x,y]=ode23('ftest421',0,4,1)
Error using odearguments (line 81)
The last entry in tspan must be different from the first entry.

Error in ode23 (line 113)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...

>> [x,y]=ode23('ftest421',0,4,1)
Error using odearguments (line 81)
The last entry in tspan must be different from the first entry.

Error in ode23 (line 113)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...

求解答!

改为 [x,y]=ode23(@ftest421,[0 4],1)
望采纳追问

依旧不行

追答

你的ftest421.m放在当前工作目录了么?

温馨提示:答案为网友推荐,仅供参考
相似回答
大家正在搜