There are some changes on the code compared to ode45. First of all, my odeFunction is not time dependent, so I left that part completely out. Second, since only one time step is calculated, only the new values are returned as result. Third, the odeArguments part, the events part, the check error part and many more are left out, since i don't need them.
Of course, it did not work like it should. ;)
Here is the result of a simple swinging function:
blue is my range-kutta-method, red and correct is ode45.

The function which was evaluated was:
y' ' + y = 0
function testSwingParallel
init = [1; 0];
tstart = 0;
tend = 20;
h = 0.01;
nt = (tend - tstart)/h;
tspan = linspace(tstart,tend,nt);
solution = zeros(nt,numel(init));
initTemp = init;
tic
for k = 1:nt
solution(k,:) = rungeKutta4(@myFcn,h,initTemp);
initTemp = solution(k,:)';
end
timeRungeKutta = toc;
tic
[T,Y] = ode45(@myFcnOde,tspan,init);
timeOde45 = toc;
tspan = linspace(tstart,tend,nt);
plot(tspan,solution(:,1),'b')
hold on
plot(T,Y(:,1),'r')
hold off
disp(['timeRungeKutta = ', num2str(timeRungeKutta)]);
disp(['timeOde45 = ', num2str(timeOde45)]);
end
function dy = myFcn(x)
dy = zeros(2,1);
dy(2) = x(1);
dy(1) = -x(2);
end
function dy = myFcnOde(~,x)
dy = zeros(2,1);
dy(2) = x(1);
dy(1) = -x(2);
end