% odesolv3 solves the 3D ode system
% ode3 contains the rhs of an 3D ode

t0=0; tend=200;
y01=-10.; y02=-1; y03=10.;
%y01=0.1; y02=.1; y03=0.2;
[t,y]=ode45('ode3',[t0,tend],[y01,y02,y03]);
subplot(1,3,1)
plot(t,y)
xlabel('t')
ylabel('x1,x2 ,x3')
subplot(1,3,2)
plot(y(:,1),y(:,2))
xlabel('x1')
ylabel('x2')
subplot(1,3,3)
plot3(y(:,1),y(:,2),y(:,3))

fid=fopen('X3.dat','w');
 for i=1:length(t)
  fprintf(fid,'%e\n',y(i,1));
%  fprintf(fid,'%e %e %e\n',y(i,1),y(i,2),y(i,3));
 end
fclose(fid);


