A MATLAB function which implements the collocation method of solving optimal control problems, using fmincon optimizer