MATLAB画演化博弈图,演化博弈matlab程序与作图

演化博弈matlab程序与作图

%函数

function dxdt=differential(t,x)

dxdt=[x(1)*(1-x(1))*(5-6*x(2));x(2)*(1-x(2))*(1-6*x(1))]; end

%主程序

clear

%y-x

for i=0:0.1:1

for j=0:0.1:1

[T,Y]=ode45('differential',[0 5],[i j]); figure(1)

grid on

plot(Y(:,1),Y(:,2));

hold on

end

end

%dx/dt-t

for i=0:0.1:1

for j=0:0.1:1

[T,Y]=ode45('differential',[0 5],[i j]);

figure(2)

grid on

plot(T,Y(:,1));

hold on

end

end

%dy/dt-t

for i=0:0.1:1

for j=0:0.1:1

[T,Y]=ode45('differential',[0 5],[i j]); figure(3)

grid on

plot(T,Y(:,2));

hold on

end

end

你可能感兴趣的:(MATLAB画演化博弈图)