MATLAB: Use a root finding method to find a root of the derivative of the function

root finding

So I have been given an encrypted function (I can't alter it or view it) that can be invoked within matlab like so:
FabCorpV6(DesignParameter,Ncycles)
where FabCorpV6 is the encrypted function that I do not have a means of directly examining, Design Parameter is a value between -1 and 1 and Ncycles is a fixed integer from 1 to infinity. Basically, I need to use a root-finding method to determine what value of the DesignParameter would yield the minimum value possible for FabCorpV6. Any help with this is much appreciated. Right now I am hung up on how I'm supposed to use Matlab to evaluate the derivative of FabCorpV6 as a function of a fixed value for Ncycles of 5 and a range of values for the DesignParameter(ACCURATELY and EFFICIENTLY) in order to determine what values of the DesignParameter yield a value of zero for the derivative of FabCorpV6. Then I can evaluate the function at these extremes to determine which one is the absolute minimum of the function FabCorpV6. If anyone doesn't understand what I'm asking about, please don't hesitate to get clarification.

Best Answer

It sounds like you do not understand the problem at all. As you said the specified function doesn't have a zero value and you are not applying the root finding method to this function. You are applying the root finding method to its derivative. Find the derivative first and when you apply the root finding that will get you the local min/max values as the slope is zero at the local max/min. you say you cannot just perform a typical differentiation but how about an approximation? such as you'd use the trapezoidal method to approximate an integral.