Help with setting up an optimization problem

1 visualización (últimos 30 días)
Cole
Cole el 8 de Oct. de 2014
Respondida: Alan Weiss el 13 de Oct. de 2014
Hi,
I have a question about setting up an optimization problem. I have a function that looks like this:
[ correlation ] = my_function ( input1, input2, input3, optParm )
My_function calls a bunch of different image processing sub routines that I've written and inputs 1, 2 and 3 are arrays of photos that need to be loaded into the function. The function basically processes 100 images and then compares the automatically measured results to the manually measured results. Anyway, I don't know if the details of my program really matter. I'm having trouble setting up the optimization portion of this.
This is what I have so far; most of which is taken from the help files:
options = optimoptions(@fminunc,'Algorithm','quasi-newton');
optParm0 = 10;
[optParm,fval,exitflag,output] = fminunc(@CP_Process_All,optParm0,options);
I want the optimizer to try all different values of optParm, starting with 10 and maximize the correlation. The error that I'm getting is "not enough input parameters". In all the examples, the objective function just has a single input value. I don't know how to set it up this way because my function needs the input arrays to run properly.
Any help would be greatly appreciated!
Thank you!

Respuesta aceptada

Alan Weiss
Alan Weiss el 13 de Oct. de 2014
If you need to pass the data, see Pass Extra Parameters.
However, I wonder if you have a discrete problem, where your optParm has to be an integer. If so, then you cannot use Optimization Toolbox functions, because they require that the decision variable (unknown parameter) is a continuous one.
Alan Weiss
MATLAB mathematical toolbox documentation

Más respuestas (0)

Categorías

Más información sobre Problem-Based Optimization Setup en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by