f=@(t,X) [X(2); -X(1)]; %derivatives funtion
% Call the numerical methods to compare
[te,Xe]=euler(f,[tini,tfin],X0,N);
[tr,Xr]=RK4(f,[tini,tfin],X0,N);
% opcions=odeset('RelTol',1.e-12,'AbsTol',1.e-12);
% [t,X]=ode45(f,[tini tfin],X0,opcions);
t=tr; %choose the method to plot
% Characteristics of the plot window
set(fig1,'Name','INTEGRACIO EDOs',...
'units', 'pixels','Position', [200, 50, 400, 600],...
'NumberTitle','off','Resize','on');
% --------------(t,x(t)) the x's as a function of time
% --------------(t,y(t)) the y's as a function of time
% --------------(x(t),y(t)) Phase portrait