It would help me to understand what you are doing, and might help you, if you would do the following:
- Define exactly what your control variables are, meaning the variables you want to move in order to optimize something. Are there any constraints, such as bounds, on your variables?
- Define exactly, in words or a formula (not code) what the objective function is. I mean, give a formula or exact description so that we can understand exactly what you are trying to minimize.
- After you have given us those two things, show us the code that is supposed to calculate your objective function. Not minimize your objective function, just evaluate the thing as a function of the control variables.
- After all that, maybe you will have the problem well-formulated enough that it will be possible to optimize.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation