代码如下:
clear;clc;
[T,Y] = ode45(@Rossler,[0 500],[0.1;0.1;0.1]);
hold on
plot3(Y(:,1),Y(:,2),Y(:,3),'b','LineWidth',0.5);
view(-30,40);
xlabel('x(t)','FontName','Times New Roman','FontSize',15);
ylabel('y(t)','FontName','Times New Roman','FontSize',15);
zlabel('z(t)','FontName','Times New Roman','FontSize',15);
hold off
function dy = Rossler(~,y)
a=0.2;
b=0.2;
c=5.7;
dy = zeros(3,1);
% a column vector
dy(1) = -(y(2) + y(3));
dy(2) = y(1) + a * y(2);
dy(3) = y(3) * (y(1)-c)+b;
end
|