DerivativeCheck should only be used once before the main calculation starts. This check can be done in interior points where finite-differencing does not fail.
Best wishes
Torsten.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!