y‘=x^2 (标题打错了)
m文件
function y=yfun(x)
y‘=x^2
[t,x]=ode45('yfun',[0 1],0)
哪个地方错了
求指出
谢谢
matlab是如何判断是求哪个函数的原函数的呢?
[X,Y]=ode45('yfun',[0 1],0) 此式中的X,Y哪个是自变量?哪个是函数
小白
实在不理解 [X,Y]=ode45('yfun',[0 1],0) 中 X Y 的含义
其实都在help里
引用如下:
Syntax
[t,Y] = solver(odefun,tspan,y0)
[t,Y] = solver(odefun,tspan,y0,options)
[t,Y,TE,YE,IE] = solver(odefun,tspan,y0,options)
sol = solver(odefun,[t0 tf],y0...)
where solver is one of ode45, ode23, ode113, ode15s, ode23s, ode23t, or ode23tb. ArgumentsThe following table describes the input arguments to the solvers. odefun
A function that evaluates the right side of the differential equations. All solvers solve systems of equations in the form y'=f(t,y) ...
所以y是所求,第一个变量默认为变量