『求助』我是新手 帮帮忙 这是什么错误

浏览:119981

是书上的程序:
clear
clc
t0=0;
tfinal=10;
x0=[0.2;0];
[t,x]=ode45('rlcsys',t0,tfinal,x0);
figure(1)
subplot(211)
plot(t,x(:,1))
grid
title('电容电压/v')
xlable('时间/s')
subplot(212)
plot(t,x(:,2))
grid
title('电感电流/A')
xlable('时间/s')
figure(2)
vc=x(:,1);
i=x(:,2);
plot(vc,i);
grid
title('电感电流与电容电压的关系曲线')
xlable('电容电压/v')
ylable('电感电压/A')
function xdot=rlcsys(t,x)
Vs=1.5;
R=1.6;
L=2.1;
C=0.3;
xdot=[x(2)/C;1/L*(Vs-x(1)-R*x(2))];


运行后出项下面的警告,帮帮忙,这是怎么回事?


Warning: Obsolete syntax. Use ode45(fun,tspan,y0,...) instead.
> In funfun\private\odearguments at 41
In ode45 at 173
??? Error using ==> feval
Undefined command/function 'rlcsys'.


Error in ==> funfun\private\odearguments at 110
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.


Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, ...

邀请回答 我来回答

当前暂无回答

回答可获赠 200金币

没解决?试试专家一对一服务

换一批
    App下载
    技术邻APP
    工程师必备
    • 项目客服
    • 培训客服
    • 平台客服

    TOP