MATLAB: How to write rainflow cycle counting algorithm for a load-time history

algorithm

load={25 5 14 -14 16 2 7 -12 25} and time={2 4 6 8 10 12 14 16 18}
this is my load and time . when i plot load v/s time i'll get a variable amplitude loading i have to reduce this variable amplitude loading into simple form by using rainflow cycle counting technique. so please help me how ican i start the MATLAB code for this counting method in MATLAB.