主题:ode45调用出错
clear all;
close all;
double t;
[t,y]=ode45('eq',[0:0.01:50],[0.5,0.6,0.9]);
plot3(y(:,1),y(:,2),y(:,3));
上述主程序调用下面的函数:
function dx=eq(t,x,flag)
p1=1;
p2=10;
p3=4;
dx=[p1*x(1)-x(2)*x(3);
-p2*x(2)+x(1)*x(3);
-p3*x(3)+x(1)*x(2)];
结果提醒:Mixture of single and double data for 't0', 'y0', and 'f(t0,y0)' in call to ode45.
谁能给解释一下出了什么问题?
close all;
double t;
[t,y]=ode45('eq',[0:0.01:50],[0.5,0.6,0.9]);
plot3(y(:,1),y(:,2),y(:,3));
上述主程序调用下面的函数:
function dx=eq(t,x,flag)
p1=1;
p2=10;
p3=4;
dx=[p1*x(1)-x(2)*x(3);
-p2*x(2)+x(1)*x(3);
-p3*x(3)+x(1)*x(2)];
结果提醒:Mixture of single and double data for 't0', 'y0', and 'f(t0,y0)' in call to ode45.
谁能给解释一下出了什么问题?