Help with setting up an optimization problem
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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!
0 commentaires
Réponse acceptée
Alan Weiss
le 13 Oct 2014
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
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Problem-Based Optimization Setup dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!